Re: [R] using var from bash in R script

2012-01-04 Thread dood
Marc Schwartz-3 wrote > > See ?as.formula and ?paste > > Something along the lines of the following should work: > > Args <- c("one", "two", "three") > >> Args > [1] "one" "two" "three" > >> paste(Args[1], "~", Args[2]) > [1] "one ~ two" > >> as.formula(paste(Args[1], "~", Args[2])) > o

Re: [R] using var from bash in R script

2012-01-04 Thread David Winsemius
On Jan 4, 2012, at 4:08 PM, dood wrote: Dear R users, This probably a really noob question, but I'm stuck. I'd like to pass some variables from bash to R as strings. I can successfully pass variables using commandArgs(), the problem is that I end up with an array. Huh? You should be get

Re: [R] using var from bash in R script

2012-01-04 Thread Marc Schwartz
On Jan 4, 2012, at 3:08 PM, dood wrote: > Dear R users, > > This probably a really noob question, but I'm stuck. I'd like to pass some > variables from bash to R as strings. I can successfully pass variables using > commandArgs(), the problem is that I end up with an array. So, for example: > >

[R] using var from bash in R script

2012-01-04 Thread dood
Dear R users, This probably a really noob question, but I'm stuck. I'd like to pass some variables from bash to R as strings. I can successfully pass variables using commandArgs(), the problem is that I end up with an array. So, for example: > Args <- commandArgs(TRUE) > Args [1] "one" "two"