Graphics error since intalling R 4.1.0

Since upgrading to R 4.1.0 I get the following problem when trying to plot using either base or ggplot graphics in RStudio 1.4.1106.

dta <- data.frame(x = 1:5, y = 1:5)
> plot(dta$x, dta$y)
Error in (function (filename = "Rplot%03d.png", width = 480, height = 480,  : 
  Graphics API version mismatch
Error in RStudioGD() : 
  Shadow graphics device error: r error 4 (R code execution error)

It works fine in Rgui. I've tried uninstalling and reinstalling RStudio, but it has no effect.

Any ideas how to fix this?
Thanks,
David

PSA: R 4.1.0 release requires RStudio Preview - RStudio IDE - RStudio Community

Ah, thank you, hadn't noticed that.
David

Oh, spoke too soon. I've installed the Preview version (1.4.1712) but still get the same error.

As the R 4.1.0 release notes state:

The graphics engine version, R_GE_version , has been bumped to 14 and so packages that provide graphics devices should be reinstalled.

I don't known what graphics device you're using here, but I guess it's some ragg device. If true, simply reinstall ragg and the error should be gone:

install.packages("ragg")
2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.