running ggplot2 in R 3.0.2

4,159 views
Skip to first unread message

Tristram Smith

unread,
Sep 28, 2013, 12:23:53 PM9/28/13
to ggp...@googlegroups.com
I upgraded to R 3.0.2 and now can't load ggplot2. I get this message:

Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
  there is no package called ‘colorspace’
Error: package or namespace load failed for ‘ggplot2’

I tried removing and re-installing the ggplot2 package, to no avail. Suggestions?

Thank you.

Ista Zahn

unread,
Sep 28, 2013, 2:03:22 PM9/28/13
to Tristram Smith, ggplot2
Hi Tristram,

This sounds strange... did you try

install.packages("ggplot2", dependencies=TRUE)

perhaps followed by

upgrade.packages(ask=FALSE, checkBuilt=TRUE)

?

If that doesn't solve it you could install colorspace manually, i.e.

install.packages("colorspace", dependencies=TRUE)

but you really shouldn't need to do that...

Best,
Ista
> --
> --
> 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/groups/opt_out.

Tristram Smith

unread,
Sep 30, 2013, 7:41:06 AM9/30/13
to ggp...@googlegroups.com, Tristram Smith
I received very useful guidance from Ista and Dennis on re-installing ggplot2 in 3.0.2. I can now load it. However, it still doesn't seem to be running properly, and reverting to 3.0.1 didn't fix the problem, so now I'm stuck again. For example, I have a very simple file called iacc:

        Area Studies
1 Lifespan Issues      34
2    Epidemiology     108
3    Risk Factors     162
4       Diagnosis     166
5         Service     211
6       Treatment     277
7         Biology     409

I try to create a straightforward Cleveland dot plot:

ggplot(iacc,aes(x=Studies,y=Area))+geom_point()

Then I get the following error message:

 in scale$trans$breaks(limits) : lazy-load database 'P' is corrupt
In addition: Warning message:
In scale$trans$breaks(limits) : internal error -3 in R_decompress1

I appreciate any guidance the group can offer.

Tris

Brandon Hurr

unread,
Sep 30, 2013, 7:44:19 AM9/30/13
to Tristram Smith, ggplot2
What's your sessionInfo() after loading ggplot2? 


Tristram Smith

unread,
Sep 30, 2013, 7:54:19 AM9/30/13
to ggp...@googlegroups.com, Tristram Smith
Hi Brandon,

Thank you for your quick reply. Here it is:

> library("ggplot2")
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252  
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                         
[5] LC_TIME=English_United States.1252   

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

other attached packages:
[1] ggplot2_0.9.3.1

loaded via a namespace (and not attached):
 [1] colorspace_1.2-3   dichromat_2.0-0    digest_0.6.3       grid_3.0.2       
 [5] gtable_0.1.2       labeling_0.2       MASS_7.3-29        munsell_0.4.2    
 [9] plyr_1.8           proto_0.3-10       RColorBrewer_1.0-5 reshape2_1.2.2   
[13] scales_0.2.3       stringr_0.6.2 

Tris

Brandon Hurr

unread,
Sep 30, 2013, 8:01:38 AM9/30/13
to Tristram Smith, ggplot2
Looks about the same as mine, but mine doesn't give me weird errors about lazy loading packages and I'm on Mac: 
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

other attached packages:
[1] ggplot2_0.9.3.1

loaded via a namespace (and not attached):
 [1] colorspace_1.2-3   dichromat_2.0-0    digest_0.6.3      
 [4] grid_3.0.2         gtable_0.1.2       labeling_0.2      
 [7] MASS_7.3-29        munsell_0.4.2      plyr_1.8          
[10] proto_0.3-10       RColorBrewer_1.0-5 reshape2_1.2.2    
[13] scales_0.2.3       stringr_0.6.2  


How did you install R? 

Also, provide a dataset and code to reproduce exactly what is happening on your machine. 

B

Tristram Smith

unread,
Sep 30, 2013, 9:14:47 AM9/30/13
to ggp...@googlegroups.com, Tristram Smith
Hi Brandon,
 
Thank you once more. Yes, I installed R directly from http://cran.r-project.org/bin/windows/base/. I installed ggplot2 from my usual CRAN mirror (UCLA).I get the same error message with every plot I try to make, so, for simplicity, I use as an example a tiny dataset and straightforward code:
 
>iacc<-read.csv("IACC2.csv")
>iacc
Area Studies
1 Lifespan Issues      34
2    Epidemiology     108
3    Risk Factors     162
4       Diagnosis     166
5         Service     211
6       Treatment     277
7         Biology     409

I try to create a straightforward Cleveland dot plot:

>ggplot(iacc,aes(x=Studies,y=Area))+geom_point()
Then I get what I agree is a "crazy" error message:
 
 in scale$trans$breaks(limits) : lazy-load database 'P' is corrupt
In addition: Warning message:
In scale$trans$breaks(limits) : internal error -3 in R_decompress1
I've made my way through the R Cookbook and R Graphics Cookbook, so I can follow recipes but have very limited understanding of the underlying R system. I greatly appreciate your help.
Tris

David Guy

unread,
Sep 30, 2013, 9:23:08 AM9/30/13
to Tristram Smith, ggplot2
Tristram,

Try re-loading ggplot2 from a different CRAN mirror (other than UCLA). It happened to me in the past that changing mirrors solves the problem.

Use chooseCRANmirror() for making a different choice 

or the repos option as below:

install.packages('RMySQL', repos='http://cran.us.r-project.org')

HTH

David
David Guy, PhD
R Statistical Consulting Inc.
Flemington, NJ USA
 
Office: 908-237-5107
Cell:    917-941-5890
Fax:    908-284-0356
Skype: david.guy1213


Brandon Hurr

unread,
Sep 30, 2013, 9:29:54 AM9/30/13
to David Guy, Tristram Smith, ggplot2
Also, a quick google search indicates that you might have a corrupt session. Can you load a completely empty session? 

If not, start R and then:
rm (list = ls(all=TRUE)) 
quit()
# Save your "workspace", should be empty now

# Restart R

B


Tristram Smith

unread,
Sep 30, 2013, 7:53:45 PM9/30/13
to ggp...@googlegroups.com, David Guy, Tristram Smith
Thank you very much, everyone! Unfortunately, removing ggplot2 and installing from another CRAN didn't work (I tried Austria and New Zealand), nor did rm (list = ls(all=TRUE)). I also received a suggestion to search for help on LazyLoad (?lazyLoad), which may be the answer if I can figure out how to set the parameters. I'll keep investigating this.

Brandon Hurr

unread,
Oct 1, 2013, 3:15:55 AM10/1/13
to Tristram Smith, ggplot2, David Guy
Hard for me to say... I only run windows rarely and I've never seen these errors. 

When's the last time you rebooted? 

Did you previously completely uninstall R previously? 

When's the last time you started with a fresh install of Windows? 

Have you got another machine you can try doing the same things on? 

Lastly, you need to probably go to r-help... as far as I can tell this isn't a ggplot-specific problem. 

B

Felix Lankester

unread,
Oct 1, 2013, 11:15:36 AM10/1/13
to ggplot2
HI All,

I seem to have 2 small problems:

1. how to get geom_points to appear on all lines on a plot, rather than just the ones from the first line of code (ie nsmeans2)

2. How to include the two dashed lines (ie the lines from nsmeans3) in the legend, with a title for each

Any help would be most appreciated,

Many thanks,

Felix

The code:

nsplot <- ggplot(data=nsmeans2[nsmeans2$trial==1,], aes(x = time,y = x, group = vacc, colour = vacc)) +
geom_line(size=0.8) +
geom_point(size = 2.0)+
geom_line(data=nsmeans3[nsmeans3$trial==1, ], linetype=4, linesize=0.9) +
xlab("Months post primary vaccination") + ylab("Titre") +
ggtitle("Mean nasal secretion titre in trial 1 - MRI & NMAIST ELISA RESULTS") +
scale_colour_discrete(name = "Vacc group", labels=c("Unvaccinated", "Vaccinated"))

The current plot:

Rplot01.pdf

Tristram Smith

unread,
Oct 1, 2013, 9:22:18 PM10/1/13
to ggp...@googlegroups.com, Tristram Smith, David Guy
I am immensely appreciative of all the detailed, helpful guidance I received. As suggested by Brandon and others, the program files on my computer somehow became corrupted. I expunged R and all related files with Revo Installer, permanently deleted them from my computer,  downloaded R into a different program file, and then downloaded ggplot2 again. Now both work. Laborious, but I learned a lot. Thank you!

Tris

Tengiz

unread,
Jul 19, 2015, 8:29:23 AM7/19/15
to ggp...@googlegroups.com, tristra...@urmc.rochester.edu
Sorry for intruding: just used Ista's guidance to solve qplot problem - couldn't load until I manually installed colorspace.
Many thanks.
T.
Reply all
Reply to author
Forward
0 new messages