I just updated to R 4.1.0 and re-installed my packages and Rstudio (on Ubuntu 20.04). Now R runs out of memory and crashes when I try to make any ggplot. The error message is long and I can't fully read it because the R session immediately aborts, but it mentions "missing nul terminator"
, "process memory read out of range"
and a bunch of lines of [XXXX:XXXX:YYYYYYYY,ZZZZZZ,AAAAAA ERROR: elf_dynamic_array_reader.h:61] tag not found
and finally [XXXX:XXXX:YYYYYYYY,ZZZZZZ,AAAAAA] ERROR directory_reader_posix.cc:42] opendir: No such file or directory (2)
(where X, Y, Z, and A are numbers).
I originally got this error with my data but it seems to happen with any ggplot:
library(ggplot2)
ggplot(mtcars, aes(x = cyl, y = mpg)) + geom_boxplot()
I think it's to do with actually displaying the plot because it doesn't crash when I save the plot into a variable and then ggsave()
it, and the resulting file is fine. It's also OK when I do ggplot(...)
within a function with ggsave()
in the next line.
The same plot in base R works fine.
boxplot(mpg~cyl, data = mtcars)
==> displays boxplot in the Plots pane
Reinstalling ggplot2 with install.packages()
didn't fix the problem, and I tried to sudo apt install ./rstudio-1.4.1106-amd64.deb
again but it just says Rstudio is already the newest version.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…