Home > Mobile >  How to read a list of variable names and substitute them in a function in R?
How to read a list of variable names and substitute them in a function in R?

Time:04-29

I would like to write a script that reads a list of variable names. These variable names are some of the column headers in a data.frame. Then I want to do a for-loop to execute various operations on the specified variables in the data.frame and print them in accordingly named files, but I can't figure out how to do the necessary variable substitution. The data.frame has 1260 columns and 2600 rows. Not all columns are continuous variables, some are factors, descriptors, etc., so I use the varlist to pick which columns I want to analyze.

I found basically the same question in enter image description here

  • Related