I\'m trying to create a plot with a semi-transparent confidence region around the regression line:
library(car)
library(ggplot2)
library(effects)
mod <- lm(s
I have faced similar problems while running packages 'dismo' and 'ggplot2' in RStudio. As this problem started after I installed 'Ghostscript' into my Window_64, I removed all these folders from my computer in order to check if its works normally. RStudio worked normally without any error after removing 'Ghostscript'. However, by using options(bitmapType="cairo") as per above postings, I could resolve the error, but I had to rerun for every time for normal functioning of RStudio.
I had the same problem under Ubuntu 16.04 when using RStudio with R v4.4.0. After updating R to v4.4.4 and running RStudio from terminal it was working fine.
Be aware that R version RStudio uses depends on the way you are starting the application (from desktop or terminal).
per request of the OP:
Can you paste the output of getOption("bitmapType")
in your config? If it's not "cairo
" try setting it to that via options(bitmapType="cairo")
and see if you get the same error.
I had exactly the same problem as the OP, but in my case setting options(bitmapType="cairo")
did not solve the problem.
In my case the problem was caused by the fact that I compiled R manually from source without the --with-cairo
configure option (or rather: my system was lacking the necessary libcairo2-dev package, the --with-cairo
did not have any effect). Recompiling R with proper cairo support fixed the issue. It now even works although getOption("bitmapType")
is still set to `"Xlib".