Skip to content

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

2 messages · Jim Lemon, Ista Zahn

#
Yes, I see what you want. I can't run this myself as my work computer
runs Windows and insists on starting Statistica when I run an R file
in batch mode. What about:

plot(adl1[,args[1]],adl1[,args[2]])

I just noticed that you are plotting in ggplot, so this won't help. Maybe:

aes(x=args[1], y=args[2])

?

Jim
On Mon, Jun 6, 2016 at 1:29 PM, Douglas Johnson <todojo at gmail.com> wrote:
#
Hi Doug,

ggplot lets you map variables to aesthetics in a few different ways,
including passing to variable names as strings to aes_string. See
?aes_string for details.

Best,
Ista
On Jun 6, 2016 1:03 AM, "Jim Lemon" <drjimlemon at gmail.com> wrote: