Hi I'm trying to return strings that subset all the columns in iris dataset. The output I'm looking for is 'iris$Sepal.Length', 'iris$Sepal.Width', 'iris$Petal.Length', 'iris$Petal.Width', 'iris$Species'.
I tried the following code below, doing a for loop with paste0 function but nothing is returned.
for(i in colnames(iris)){
paste0('iris$',i , collapse ="")
}
How can I solve this?