From stefanML at collocations.de  Sat Sep 26 10:32:54 2015
From: stefanML at collocations.de (Stefan Evert)
Date: Sat, 26 Sep 2015 10:32:54 +0200
Subject: [Rd] issues with dev.new avoiding RStudio plot device on unix?
In-Reply-To: <56062226.8010005@skyeome.net>
References: <5605982E.5000104@skyeome.net>
	<CAMMJQ0Y2dHA2wjdzNQznEA=cfh7PLdQH4XBBzJcdzoVUx19EMA@mail.gmail.com>
	<56062226.8010005@skyeome.net>
Message-ID: <F0481E92-7EA1-414C-B42E-B656A78D01F4@collocations.de>

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")
		windows
	else if (.Platform$GUI == "AQUA" || ((!nzchar(dsp) || grepl("^/tmp/launch-", dsp)) && .Call(C_makeQuartzDefault)))
		quartz
	else if (nzchar(dsp) && .Platform$GUI %in% c("X11", "Tk"))
		X11
	else defdev 

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

	/private/tmp/com.apple.launchd.2wKas4wzPe/org.macosforge.xquartz:0

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

Best,
Stefan


> 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.



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