[Rd] issues with dev.new avoiding RStudio plot device on unix?

Stefan Evert stefanML at collocations.de
Sat Sep 26 10:32:54 CEST 2015

Same problem here on Mac OS X 10.10.5 with R 3.2.2 and RStudio 0.99.473.

I think dev.new() tries to find a suitable device in an interactive session with this code

	dsp <- Sys.getenv("DISPLAY")
	if (.Platform$OS.type == "windows")
	else if (.Platform$GUI == "AQUA" || ((!nzchar(dsp) || grepl("^/tmp/launch-", dsp)) && .Call(C_makeQuartzDefault)))
	else if (nzchar(dsp) && .Platform$GUI %in% c("X11", "Tk"))
	else defdev 

which fails for me because RStudio sets .Platform$GUI to "RStudio" (thanks, RStudio!) and my DISPLAY variable looks like this


so the grepl() on dsp doesn't match.


> On 26 Sep 2015, at 06:42, Skye Bender-deMoll <skyebend at skyeome.net> wrote:
> Sorry, should have given more background.  x11 works fine on all my systems when called by x11().  I'm the maintainer of a package that uses the animation library, which has performance issues when used with the RStudio plot device.  But if you call plot.new() when using RStudio, you get an RStudio device, not the standard device for the platform because it overrides the device option.  So I've had to have the library do platform detection and platform-specific device calls, which R CMD check doesn't like.  I believe that noRStudioGD argument was avoided to give users a way around this, but it doesn't seem to be behaving correctly in the unix interactive case.

More information about the R-devel mailing list