As pointed out in the comments, a dataframe is already a list of vectors. You can access the vectors using double bracket syntax. So you don't need to store them in new variables. Like so:
# Subset iris data frame for illustration purposes
df <- iris[1:5, ]
# Create sample function to print out class and vector values
myfunction <- function(vct) {
print(class(vct))
print(vct)
}
# Iterate columns and pass to function
for (i in 1:ncol(df)) {
myfunction(df[[i]])
}
# Results
# [1] "numeric"
# [1] 5.1 4.9 4.7 4.6 5.0
# [1] "numeric"
# [1] 3.5 3.0 3.2 3.1 3.6
# [1] "numeric"
# [1] 1.4 1.4 1.3 1.5 1.4
# [1] "numeric"
# [1] 0.2 0.2 0.2 0.2 0.2
# [1] "factor"
# [1] setosa setosa setosa setosa setosa
# Levels: setosa versicolor virginica