Charles Geyer
2014-May-22 21:00 UTC
[R] equivalent of R CMD BATCH --vanilla for those who can't do anything non-GUI?
For a Google Group about aster models, I want to say that people wanting help are best advised to provide an example that works as R CMD BATCH --vanilla foo.R but I realize that many R users have zero idea of how to start R in any way other than clicking on an icon. Is there a way to start up the standard mac and windows GUIs or Rstudio with no loaded saved global environment? (Without making it impossible to go back to what they were doing before?) Is there a way to make the source function do the job (ignore everything in the global environment)? What do you tell users about how to make an example that doesn't assume there is huge amounts of crap that the user doesn't even remember what it is that is involved? Do I just have to explain the command line to all the GUI fans? -- Charles Geyer Professor, School of Statistics University of Minnesota charlie@stat.umn.edu [[alternative HTML version deleted]]
Greg Snow
2014-May-22 21:16 UTC
[R] equivalent of R CMD BATCH --vanilla for those who can't do anything non-GUI?
You could have them spawn a vanilla R session using system instead of the command line: system('R CMD BATH --vanilla foo.R') Or you could use the local argument to source to evaluate in a new environment that does not inherit from the global environment: source('foo.R', local=new.env(parent=parent.env(.GlobalEnv))) this will prevent the code seeing anything in the global environment, but it could still use functions/objects from any loaded packages. On Thu, May 22, 2014 at 3:00 PM, Charles Geyer <charlie at stat.umn.edu> wrote:> For a Google Group about aster models, I want to say that people wanting > help are best advised to provide an example that works as > > R CMD BATCH --vanilla foo.R > > but I realize that many R users have zero idea of how to start R in any way > other than clicking on an icon. Is there a way to start up the standard > mac and windows GUIs or Rstudio with no loaded saved global environment? > (Without making it impossible to go back to what they were doing before?) > > Is there a way to make the source function do the job (ignore everything in > the global environment)? > > What do you tell users about how to make an example that doesn't assume > there is huge amounts of crap that the user doesn't even remember what it > is that is involved? > > Do I just have to explain the command line to all the GUI fans? > > -- > Charles Geyer > Professor, School of Statistics > University of Minnesota > charlie at stat.umn.edu > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.-- Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com
Duncan Murdoch
2014-May-22 21:41 UTC
[R] equivalent of R CMD BATCH --vanilla for those who can't do anything non-GUI?
On 22/05/2014, 5:00 PM, Charles Geyer wrote:> For a Google Group about aster models, I want to say that people wanting > help are best advised to provide an example that works as > > R CMD BATCH --vanilla foo.R > > but I realize that many R users have zero idea of how to start R in any way > other than clicking on an icon. Is there a way to start up the standard > mac and windows GUIs or Rstudio with no loaded saved global environment? > (Without making it impossible to go back to what they were doing before?)On Windows, you can copy the shortcut, and edit it to add a --vanilla option to the command line.> > Is there a way to make the source function do the job (ignore everything in > the global environment)?Only in the way Greg said: start a new R process to run it.> > What do you tell users about how to make an example that doesn't assume > there is huge amounts of crap that the user doesn't even remember what it > is that is involved?I just ask for a "minimal, self-contained example". You won't always get that, but I suspect people won't always follow your --vanilla instructions, either. Duncan Murdoch> > Do I just have to explain the command line to all the GUI fans? >