[R-SIG-Mac] Determine GUI status

Simon Urbanek simon.urbanek at r-project.org
Sun May 6 16:51:32 CEST 2007


On May 4, 2007, at 10:02 PM, Steven McKinney wrote:

>
> Is there a way to programatically
> check whether the R session is
> running with R.app (versus, say
> running in Emacs ESS mode in an
> Emacs buffer)?
>

try
if (nchar(Sys.getenv("R_GUI_APP_VERSION")))

R.app will always set R_GUI_APP_VERSION to the version of the GUI.



> I'd like to programatically decide on
> appropriate plot devices etc.
>
> I've checked Sys.info() and related functions
> but I'm not noticing R.app info in
> any returned fields.

R.app is just an application embedding R, but Sys.info comes from R  
itself, so it cannot reflect the status of the R.app.


>   Either I missed something or I haven't found the right function  
> call yet.
>

There is currently no documented function for this, but I'll add  
something ... (BTW an indirect check is also "tools:RGUI" %in% search 
() but that is not guaranteed to not go away)

Cheers,
Simon

PS: .Platform$GUI=="AQUA" is not limited to R.app, it includes other  
Mac GUIs as well, but is also a good estimate

> Any info appreciated.
>
>
> Best
>
> Steven McKinney
>
> Statistician
> Molecular Oncology and Breast Cancer Program
> British Columbia Cancer Research Centre
>
> email: smckinney at bccrc.ca
>
> tel: 604-675-8000 x7561
>
> BCCRC
> Molecular Oncology
> 675 West 10th Ave, Floor 4
> Vancouver B.C.
> V5Z 1L3
> Canada
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>



More information about the R-SIG-Mac mailing list