ggplot2 crashes in RStudio but work is base R

Rstudio Version 1.4.1106
R version 4.1.0 (2021-05-18)
Ubuntu 20.04

I am having a serious problem with ggplot2. It is crashing RStudio/R and forcing a reset. I am not sure of the cause but I had a problem with a wonky keyboarld that forced a couple of hard resets before I realized the problem and replaced the keyboard so that may be the problem.

When I opened Rstudio it informed me that there was no tidyverse, Hmisc or patchwork which are library calls that I keep in my default working junk .r file.

These were listed in the package list. I deleted them and reinstalled and tried to use ggplot2. Crash. Finally removed and re-installed RStudio and re-installed RStudio. Crash.

ggplot2 works fine in R in the system terminal but crashes in the RStudio terminal.

Purge RStudio, reinstall just ggplot2. Crash.
Install tibble and readr Both work as does Hmisc

A simple plot(x, y) works.

library(ggplot2)
 ggplot(mtcars, aes(hp, wt)) + geom_line()

The best example of the result that I can supply is a screenshot.

For compatibility with the new R 4.1.0 version, use the RStudio preview.

1 Like

Thanks. I had not thought of that.

I get to install RStduio for the third time today! :smile:

Worked like a charm. Many thanks.

This topic was automatically closed 7 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.