Skip to content
Prev 3591 / 15075 Next

Determine GUI status

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

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

R.app will always set R_GUI_APP_VERSION to the version of the GUI.
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.
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