Hello All,
I have installed R (version 4.0) as well as ggplot2 (version 3.3.1) and
the tidyverse packge. I was going through some code from the book "R for
Data Science". I was working with the diamonds dataset when I
encountered the problem. I tried the following code:
library(ggplot2)
ggplot(data=diamonds) +
geom_bar(mapping=aes(cut))
which produced the expected bar graph. Then I tried:
ggplot(data=diamonds) +
geom_bar(mapping=aes(cut, color = cut))
This did not produce anything and caused R to hang -- I had to kill R to exit. This happened regardless of whether I was in RStudio or using R from the terminal. The curious thing is that both of the above codes work just fine with the mpg dataset. My machine is Lenovo IdeaPad Flex running Ubuntu linux 20.04 LTS with 16GB of RAM and the processor is Intel i7 8th gen with GPU so resources should not be an issue for handling the large diamonds dataset--which is not really that large but certainly larger than the mpg dataset. The exact same thing was happening with R version 3.6.3 which I replaced with version 4.0.
Continuing to debug and trying to understand what is going on I plotted a histogram of the variable carat dataset . After this the geom_bar worked as expected but unfortunately reverts to not working properly when R is restarted.
Any help in understanding and eventually resolving this issue is greatly appreciated.
Cheers,
Aref
To unsubscribe: email ggp...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggp...@googlegroups.com.
This is not a solution but a workaround. I downloaded the diamonds.csv file and used it to do the plotting. All is good and works with no problems. I think the issue is either in how the dataset is stored or fetched from the ggplot2 library . The flights dataset from the library nycflights13 is quite a bit larger dataset than the diamonds dataset and it works fine. I am not going to worry about it for the time being. The issue could be related to settings or configuration specific to the installation on my machine. However, the options in Rstudio settings are not helpful and I can't seem to find any information regarding settings and configuration for R or Rstudio. Thanks for those who took the time to try to help me resolve this issue. Much appreciated.
Cheers