Error in RStudioGD() :

stevendrandolph's Avatar

stevendrandolph

17 Sep, 2012 11:54 AM

I have a new installation of R and R studio: each time i try and test the graphics I get the following type of error. I cannot find any information that helps me to understand how to fix this device error.

plot(cars) Error in RStudioGD() :
Shadow graphics device error: r error 4 (R code execution error) demo(graphics)

demo(graphics)
---- ~~~~~~~~

Type to start :

require(datasets)

require(grDevices); require(graphics)

Here is some code which illustrates some of the differences between

R and S graphics capabilities. Note that colors are generally specified

by a character string name (taken from the X11 rgb.txt file) and that line

textures are given similarly. The parameter "bg" sets the background

parameter for the plot and there is also an "fg" parameter which sets

the foreground color.

x <- stats::rnorm(50)

opar <- par(bg = "white") Error in RStudioGD() :
Shadow graphics device error: r error 4 (R code execution error)

  1. Support Staff 2 Posted by Josh Paulson on 20 Sep, 2012 12:55 AM

    Josh Paulson's Avatar

    Steven,

    The RStudio graphics device is just using R to create a png file. Can you try opening the png device and saving a plot? Here is an example to try:

    > png()
    > plot(cars)
    > dev.off()
    

    This will save a plot to the current working directory. Can you see if that works?

    Josh

  2. Josh Paulson closed this discussion on 26 Sep, 2012 12:48 AM.

Comments are currently closed for this discussion. You can start a new one.