ggplot2 always crashes RStudio

1,223 views
Skip to first unread message

Thomas Koller

unread,
Dec 30, 2015, 8:49:36 AM12/30/15
to ggplot2
Hi all,

I have a severe constant problem with ggplot2 in RStudio on my desktop computer at work (Windows 7, quite powerful spec: 8GB RAM, Intel i7 CPU). I would like to ask if anyone else had similar problems and if so, what you did to solve the problem.

The description of the problem is very easy: ggplot2 crashes RStudio always, even with simple scripts

library(ggplot2)
data("mtcars")
ggplot(mtcars, aes(mpg, wt)) + geom_point()  

As soon as I execute the script line where the ggplot should be generated (here the third script line), RStudio shuts down after about 0.2 seconds.
It happened with ggplot2 v1 and it happens as well with ggplot v2. I never had this problem on another computer. And I never had such a problem with another R package on my desktop computer at work.


Cheers,

Thomas


Roman Luštrik

unread,
Dec 30, 2015, 8:52:22 AM12/30/15
to Thomas Koller, ggplot2
Can we assume you are running the latest versions of R and Rstudio?

Cheers,
Roman

--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
 
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@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 ggplot2+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
In God we trust, all others bring data.
Message has been deleted

Thomas Koller

unread,
Dec 30, 2015, 9:02:47 AM12/30/15
to ggplot2, kol...@exito.de

I am currently running R version 3.2.2 (not the latest version 3.2.3 for compatibility reasons in the company) and RStudio 0.99.491 (latest stable version from the RStudio website)

Marco Gamba

unread,
Dec 30, 2015, 9:09:47 AM12/30/15
to Dr. Thomas Koller - exito.de, Roman Luštrik, ggplot2
I have found several issue in the new version. 
Even if I updated both R and R-studio on my mac (to their latest versions).
Marco

Marco Gamba, PhD
Dipartimento di Scienze della Vita e Biologia dei Sistemi - Life Sciences and Systems Biology
Via Accademia Albertina, 13
10123 Torino, Italia





On 30 Dec 2015, at 14:56, Dr. Thomas Koller - exito.de <kol...@exito.de> wrote:

I am currently running R version 3.2.2 (not the latest version 3.2.3 for compatibility reasons in the company) and RStudio 0.99.484
 
 
Kind regards,
 
Thomas

Ista Zahn

unread,
Dec 30, 2015, 9:16:57 AM12/30/15
to Marco Gamba, ggplot2, Roman Luštrik, Dr. Thomas Koller - exito.de

ggplot2 bug reports belong at https://github.com/hadley/ggplot2/issues.

Thomas Koller

unread,
Dec 30, 2015, 9:18:17 AM12/30/15
to ggplot2, kol...@exito.de, roman....@gmail.com
Here's a short screencast: https://drive.google.com/open?id=0B-1aywTKlhBlcDJVY3lWVU5oYTA

RStudio just "disappears". I haven't found any useful log information in ..\AppData\Local\RStudio-Desktop\log  



Am Mittwoch, 30. Dezember 2015 15:09:47 UTC+1 schrieb mgamba:
I have found several issue in the new version. 
Even if I updated both R and R-studio on my mac (to their latest versions).
Marco

Ista Zahn

unread,
Dec 30, 2015, 9:19:52 AM12/30/15
to Dr. Thomas Koller - exito.de, ggplot2, Roman Luštrik

OK, but this is not the best place to report ggplot2 bugs. See https://github.com/hadley/ggplot2/issues

Thomas Koller

unread,
Dec 30, 2015, 9:25:19 AM12/30/15
to ggplot2, kol...@exito.de, roman....@gmail.com
Thanks! I just posted it there.

Hadley Wickham

unread,
Dec 30, 2015, 9:26:57 AM12/30/15
to Thomas Koller, ggplot2, Roman Luštrik
This is unlikely to be a ggplot2 bug. It's most likely to be a
combination of install packages that use different versions of Rcpp.
I'd recommend starting by running update.packages()

Hadley
http://had.co.nz/

Thomas Koller

unread,
Dec 30, 2015, 9:30:56 AM12/30/15
to ggplot2, kol...@exito.de, roman....@gmail.com
I updated the packages this morning and did it a couple of times in the last few weeks. The problem with ggplot2 has been there for quite a while. 
Would you recommend a certain sequence of uninstalling and reinstalling certain packages?

Thomas Koller

unread,
Dec 30, 2015, 9:41:46 AM12/30/15
to ggplot2, kol...@exito.de, roman....@gmail.com
For testing purposes I just uninstalled R 3.2.2, installed R 3.2.3 and only installed ggplot2 as an additional package. Unfortunately the same result as before.

Hadley Wickham

unread,
Dec 30, 2015, 9:57:29 AM12/30/15
to Thomas Koller, ggplot2, Roman Luštrik
> For testing purposes I just uninstalled R 3.2.2, installed R 3.2.3 and only
> installed ggplot2 as an additional package. Unfortunately the same result as
> before.

Uninstalling and reinstalling R won't help because it doesn't affect
the packages you have installed. It is extremely unlikely to be a bug
in ggplot2 because hundreds of other people have successful used
ggplot2.

Hadley

--
http://had.co.nz/

Thomas Koller

unread,
Dec 30, 2015, 10:17:03 AM12/30/15
to ggplot2, kol...@exito.de, roman....@gmail.com
I know that ggplot2 usually works fine. I haven't had any problems with it on my other computers.

At least how I understood so far the R installation config on Windows, the package installations of R 3.2.2 and R 3.2.3 are not related to each other if I choose to install R to the respective default path.
R 3.2.2 will be installed to C:\Program Files\R\R-3.2.2 (packages will be written to the C:\Program Files\R\R-3.2.2\library subfolder) and R 3.2.3 will be installed to C:\Program Files\R\R-3.2.3 (packages -> C:\Program Files\R\R-3.2.3\library)
Please tell me if I am wrong with this.

Hadley Wickham

unread,
Dec 30, 2015, 10:35:22 AM12/30/15
to Thomas Koller, ggplot2, Roman Luštrik
Normally packages are shared across minor versions. But you can easily
check with .libPaths()

Hadley

Thomas Koller

unread,
Dec 30, 2015, 11:02:52 AM12/30/15
to ggplot2
In the meantime I switched back to R 3.2.2 (after uninstalling R 3.2.3) because R 3.2.2 is the version I should stick to at the moment.
When I run .libPaths(), I only get the libs folder of the currently installed R version:     

> .libPaths()
[1] "C:/Program Files/R/R-3.2.2/library"


In the meantime I had a quite funny observation in RStudio. Le me tell you what happened:

Nicole B. posted to this group the following questions (I can't see her post right now, so I suppose that she deleted it):

"Could the problem be with RStudio? 
Can you run the ggplot2 scripts in R outside of RStudio? "

I tested this with RScript from the Windows command line, writing the ggplot2 output to png and pdf files (with the "png" and "pdf" commands and dev.off() at the end).
This worked without any problems.

Then I switched back to RStudio. First I forgot to comment out    dev.off()      and ran the R script. What happened? Didn't crash, but also did not show any plot in the "Plots" windows.
Then I commented out     dev.off()    
First attempt: Ran ggplot2 without any problems and showed the plot in the "Plots" windows. 
Second attempt: crashed again!


Any ideas about this behaviour?

Nicole Barker

unread,
Dec 30, 2015, 11:29:19 AM12/30/15
to Thomas Koller, ggplot2
My previous post got bounced back; I wrote from an email address that isn't part of the Google Group. 

I had some issues with RStudio when I updated ggplot2, R, and various other packages. I'm currently on V 0.99.489 and most problems are gone. I also ran updateR to update all packages. Time consuming to T/F all of them, but I was trouble-shooting some errors, so it was necessary. 

I'd suggest uninstalling and reinstalling (the most recent version of) RStudio. Ensure that the version of R connected to RStudio is the most recent (or your preferred) version, if you have multiple versions of R on your computer. And then run updateR to migrate/update all installed packages. 


Nicole K.S. Barker
Coordinating Scientist
Boreal Avian Modelling Project

Message has been deleted

Thomas Koller

unread,
Jan 4, 2016, 4:55:12 AM1/4/16
to ggplot2, kol...@exito.de
Hi Nicole,

I updated my R installation with updateR and also made a fresh install with RStudio 0.99.491 (the latest release version from the website). Unfortunately the problem persists. 

I did some further research into how RStudio handles ggplot2 requests. Although I haven't found anything to resolve the problem yet, here's what I found out, in case it's of interest to anyone:

When you start RStudio on Windows 7, a new folder will be created in C:\Users\[USERNAME]\AppData\Local\Temp:



Initially this folder contains the following folders and files:


When you create a plot with ggplot2 in RStudio, the contents of this folder look like:



In the sub-folder "rs-graphics-..." you can actually find a png file of the plot created with ggplot2:


So the generation of the plot with ggplot2 does not seem to be the problem. Rather it might be the case that RStudio can't manage to display the created plot in the RStudio interface.

Does anyone have an idea which media interfaces RStudio uses to display plots in the "Plots" window?



I will post this problem to the RStudio community support to see if anyone there has any useful hints.


Cheers,

Thomas

Thomas Koller

unread,
Jan 5, 2016, 5:18:03 AM1/5/16
to ggplot2, kol...@exito.de
Problem solved!

After some more hours of testing and tearing my hair out, I managed to track down and wipe out the culprit. The problem was ...

... an entry in the system PATH of the Windows environment variables:


I'm using XAMPP (https://www.apachefriends.org/index.html) as a local server environment. A while ago I added the path to the XAMPP PHP subfolder (C:\Internet\xampp\php) to the Windows PATH variable in order to be able to call the PHP interpreter from the command line from any working directory. 


btw: I haven't further investigated which file in the XAMPP PHP subfolder brings down RStudio when creating a ggplot. It's not an essential Windows PATH setting for me, so I'm just leaving it out from now on.


Another note: creating plots without ggplot - for example with the plot() function - worked all the time.

Yashaswita R. Bhoir

unread,
Feb 2, 2018, 9:38:00 AM2/2/18
to ggplot2
All I did was update ALL packages! It worked for me at least. 
Reply all
Reply to author
Forward
0 new messages