equivalent of R CMD BATCH --vanilla for those who can't do anything non-GUI?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

equivalent of R CMD BATCH --vanilla for those who can't do anything non-GUI?

Charles Geyer
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
[hidden email]

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: equivalent of R CMD BATCH --vanilla for those who can't do anything non-GUI?

glsnow
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 <[hidden email]> 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
> [hidden email]
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.
[hidden email]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: equivalent of R CMD BATCH --vanilla for those who can't do anything non-GUI?

Duncan Murdoch-2
In reply to this post by Charles Geyer
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?
>

______________________________________________
[hidden email] 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.