0

I have a vector list:

indieVars <- c("COL1","COL2","COL3")

I want to run this code

for(indieVar in indieVars){
  myDataFrame$indieVar
}

Only problem is the loop thinks it's looking for a column in myDataFrame called indieVar. I want it to look for the column name represented by indieVar. How do I do this?

Username
  • 3,463
  • 11
  • 68
  • 111

0 Answers0