
Dear Jeff, thanks ever so much for your comment.

Please excuse me, but is it really not an R question?? well, my IT support team at the lab said it is not an informatics question either, so what shall I do? Complain to my boss because they don't "speak" R?. I found information for an R function(?) called Rscript in the R utils package that deals with this in some way (that I am not understanding completely), so somehow I think this is not a bad forum to ask. 

All the best,

Dave

> Subject: Re: [R] R-bash beginneR
> From: jdnewmil@dcn.davis.ca.us
> Date: Mon, 7 Nov 2011 08:29:43 -0800
> To: dasolexa@hotmail.com; r-help@r-project.org
> 
> This is not an R question. Use the print function in R and use backticks in bash.
> ---------------------------------------------------------------------------
> Jeff Newmiller                        The     .....       .....  Go Live...
> DCN:<jdnewmil@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
>                                       Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> /Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
> --------------------------------------------------------------------------- 
> Sent from my phone. Please excuse my brevity.
> 
> "David A." <dasolexa@hotmail.com> wrote:
> 
> >
> >Hi,
> >
> >I am trying to run some R commands into my bash scripts and want to use
> >shell variables in the R commands and store the output of R objects
> >into shell variables for further usage in downstream analyses. So far I
> >have managed the first, but how to get values out of R script? I am
> >using  "here documents" (as a starter, maybe something else is simpler
> >or better; suggestions greatly appreciated).
> >
> >A basic random example:
> >
> >#!/bin/sh
> >MYVAR=2
> >R --slave --quiet --no-save <<EEE
> >x<-5
> >
> >z<-x/$MYVAR
> >zz<-x*$MYVAR
> >EEE 
> >
> >
> >How get the values of z and zz into shell variables?
> >
> >
> >Thanks
> >
> >D
> > 		 	   		  
> >	[[alternative HTML version deleted]]
> >
> >______________________________________________
> >R-help@r-project.org mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.
> 
 		 	   		  
	[[alternative HTML version deleted]]

