Skip to content
Prev 361500 / 398503 Next

How to specify a data frame column using command line arg?

Hi Doug,
I think this will work for you:

adl1<-read.csv("test.csv")
adl1[,"a"]
[1] 1 4 7

so, adl1[,args[1]] should get you the column that you pass as the
first argument.

Jim
On Mon, Jun 6, 2016 at 5:45 AM, Douglas Johnson <todojo at gmail.com> wrote: