Re: [R] export variable from bash to R

2012-10-30 Thread sophie
Hi Barry, OK, now I absolutely do feel like the newbie I am :-) I added the function call, and - what a surprise - everything is working fine. Thanks a lot, sophie -- View this message in context: http://r.789695.n4.nabble.com/export-variable-from-bash-to-R-tp4647749p4647912.html Sent from t

Re: [R] export variable from bash to R

2012-10-30 Thread Barry Rowlingson
On Tue, Oct 30, 2012 at 4:34 PM, sophie wrote: > Hi Barry, > > I already tried adding print commands, but even if I put the print command > right under "myscript <- function()", there is no printed output in the > shell... If your script is just: myscript <- function(){ # some stuff } The

Re: [R] export variable from bash to R

2012-10-30 Thread sophie
Hi Barry, I already tried adding print commands, but even if I put the print command right under "myscript <- function()", there is no printed output in the shell... sophie -- View this message in context: http://r.789695.n4.nabble.com/export-variable-from-bash-to-R-tp4647749p4647897.html Sen

Re: [R] export variable from bash to R

2012-10-30 Thread Barry Rowlingson
On Tue, Oct 30, 2012 at 2:03 PM, sophie wrote: > Hi Barry > > Thank you very much for your reply. I changed my scripts according to your > suggestions - this is how they look now: > > #!/bin/bash > > VARIABLES=( a b c d ) > > for i in ${VARIABLES[@]}; do > export VARIABLENAME=$i > Rscr

Re: [R] export variable from bash to R

2012-10-30 Thread sophie
Hi Barry Thank you very much for your reply. I changed my scripts according to your suggestions - this is how they look now: #!/bin/bash VARIABLES=( a b c d ) for i in ${VARIABLES[@]}; do export VARIABLENAME=$i Rscript -e 'source("myscript.R")' done and in the R program, I used ar

Re: [R] export variable from bash to R

2012-10-29 Thread Barry Rowlingson
On Mon, Oct 29, 2012 at 10:43 AM, sophie wrote: > Dear R experts > > This probably seems very easy to you guys, but I'm a beginner and would be > really glad if someone helped me with this: > I am trying to automate the execution of an R script (let's call it > "myscript.R") by passing a variable

Re: [R] export variable from bash to R

2012-10-29 Thread Krzysztof Mitko
W dniu 29.10.2012 11:43, sophie pisze: > Dear R experts > > This probably seems very easy to you guys, but I'm a beginner and would be > really glad if someone helped me with this: > I am trying to automate the execution of an R script (let's call it > "myscript.R") by passing a variable from a ba

[R] export variable from bash to R

2012-10-29 Thread sophie
Dear R experts This probably seems very easy to you guys, but I'm a beginner and would be really glad if someone helped me with this: I am trying to automate the execution of an R script (let's call it "myscript.R") by passing a variable from a bash script to myscript.R. I know I can use the comm