Error when trying to load library(ggplot2) in R
Asked Answered
A

1

3

I'm having trouble loading the ggplot2 library in R. Below is the code that I type in. Anyone have any ideas on how to make this work?

> library(ggplot2)
Error in get(x, envir = this, inherits = inh) : 
  unused argument(s) (envir = this, inherits = inh)

Error : unable to load R code in package 'ggplot2'

Error: package/namespace load failed for 'ggplot2'

Edit 1: More Info

> sessionInfo()
 R version 2.13.0 (2011-04-13)
 Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

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

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

 other attached packages:
 [1] quantmod_0.3-15 TTR_0.20-2      xts_0.8-0       zoo_1.6-5   Defaults_1.1-1
 [6] reshape2_1.1    proto_0.3-9.2   reshape_0.8.4   plyr_1.5.2

 loaded via a namespace (and not attached):
 [1] lattice_0.19-26 stringr_0.4     tools_2.13.0

Edit 2:

The version of ggplot2 that I'm trying to use is 0.8.9. When I call the traceback function I get the following result:

> traceback()
  2: stop(gettextf("package/namespace load failed for '%s'", package),
       call. = FALSE, domain = NA)
  1: library(ggplot2)
Adelladella answered 19/5, 2011 at 23:56 Comment(7)
I probably can't help you, but the folks than can will likely want more details; specifically the output from running sessionInfo() would be a good start.Masculine
Ok cool, I'll update with that info!Adelladella
What version of ggplot2 are you trying to load? What's the output of traceback() after library fails?Maintenon
Have you tried to reinstall the package?Antrum
@Joshua Ulrich: I've added the requested info. Also @Manoel I have, in fact I reinstalled R itself. I'll try again though.Adelladella
@Shreyasm, Have you tried using a different repo to install ggplot2 from?Mcdonald
@Shreyasm, also try update.packages(checkBuilt=TRUE)Mcdonald
I
4

Quit R. Go into your /Library/Frameworks/R.framework/Versions/2.13/Resources/library/ directory and trash the entire folder. If you have any other libraries make sure they don't have any copies, either. Restart R and reinstall and make sure you install all dependencies. There is a check mark option in the GUI Package Installer or you can use (at the command line: install.packages("ggplot2", dependencies=c("Depends", "Imports", "Suggests") ).

Further thought: Obscure errors in the MacOS can sometimes be resolved by repairing disk permissions. The Disk Utility.app program is the way I usually do it. Some people run it on a regular basis although I only do so when a problem arises that seems to be a file access issue.

Inconsolable answered 20/5, 2011 at 1:59 Comment(3)
do not pass go, do not collect $200 dollars, tis what is probably needed though. +1Belloir
@shreyasm: did you install the Mac binary or build from source?Maintenon
@Joshua Ulrich I installed the Mac Binary.Adelladella

© 2022 - 2024 — McMap. All rights reserved.