Skip to content

trouble loading ggplot2 using R

8 messages · ramonovelar, Hadley Wickham, Ramon Ovelar +2 more

#
Hello, 

I have a similar error, running R in Snow Leopard too
Error : .onAttach failed in attachNamespace() for 'ggplot2', details:
  call: stats::runif(1)
  error: .Random.seed no es un vector de n?meros enteros pero es de tipo
'list'
Error: package/namespace load failed for ?ggplot2?

does anybody have this package running in Snow Leopard?
thks in advance.

Ram?n Ovelar


--
View this message in context: http://r.789695.n4.nabble.com/trouble-loading-ggplot2-using-R-tp3332044p4583459.html
Sent from the R help mailing list archive at Nabble.com.
#
What is the output of your sessionInfo()? Many folks have ggplot2
running on Snow Leopard (myself included) -- most likely, you need to
update something or other...

Michael
On Tue, Apr 24, 2012 at 9:26 AM, ramonovelar <ramon.ovelar at gmail.com> wrote:
#
Hi, thanks for the answer. 

Here is the output:
R version 2.14.1 (2011-12-22)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

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

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

other attached packages:
[1] gplots_2.10.1     KernSmooth_2.23-7 caTools_1.12      bitops_1.0-4.1   
[5] gdata_2.8.2       gtools_2.6.2     

loaded via a namespace (and not attached):
 [1] MASS_7.3-16        RColorBrewer_1.0-5 colorspace_1.1-1  
dichromat_1.2-4   
 [5] digest_0.5.2       ggplot2_0.9.0      memoise_0.1        munsell_0.3       
 [9] plyr_1.7.1         proto_0.3-9.2      reshape2_1.2.1     scales_0.2.0      
[13] stringr_0.6        tools_2.14.1      

--
View this message in context: http://r.789695.n4.nabble.com/trouble-loading-ggplot2-using-R-tp3332044p4583568.html
Sent from the R help mailing list archive at Nabble.com.
#
That's a completely different error.  Are you setting .Random.seed to
something non-standard?  That's what the error message suggests.

Hadley
#
On Wed, Apr 25, 2012 at 6:27 AM, Ramon Ovelar <ramon.ovelar at gmail.com> wrote:
That's definitely not what it should look like - you might want to
start from a fresh R workspace.

Hadley
#
On Apr 25, 2012, at 8:27 AM, Ramon Ovelar wrote:

            
That _is_ a problem. It _should_ be an integer atomic vector, although  
it appears to be the correct length (at least is the same as  
my .Random.seed which has the same leading entry, 403, as yours)  and  
it appears to be all integers. Something you have done or some program  
has done has altered the default value. It is possible that this  
problem assignment has been saved in your (invisible) .Rdata file.

It is generally a bad idea to do anything to .Random.seed, but I don't  
see any harm at this point in trying this:

.Random.seed <- unlist(.Random.seed)

(... and then trying to install ggplot2)


That should get rid of the 'data.frame' attribute. I would also track  
down your .Rdata file and maybe also your .Rhistory file and delete  
them. You will need to learn how to do this in a Terminal session or  
you will need to learn how to display invisible files in Finder.app.  
The archives of the SIG-Mac list will have instructions.
#
Alternatively, the OP might just use set.seed(1) to get a fresh seed
rather than playing with .Random.seed directly.

To the OP: if you're on Mac, follow these instructions and we'll see
if that fixes your problem:

**) open Terminal
**) type R -q --vanilla
**) At the prompt type the following lines

set.seed(1)
install.packages("ggplot2")
library("ggplot2")
qplot(carat, price, data = head(diamonds, 200)) # Should make a nice
ggplot graph with not so many dots

**) If that works and you don't have anything important saved in your
default start up, return to Terminal and type

mv .RData .Trash

(This just puts it in the trash so we can recover it if you realize
later there actually is something important there)

**) Then start R by typing "R -q" and enter

library("ggplot2")
qplot(carat, price, data = head(diamonds, 200))

and that should work.

Hopefully that will isolate your problem. If anything fails along the
way, let us know exactly where and how.

Best,
Michael
On Wed, Apr 25, 2012 at 9:42 AM, David Winsemius <dwinsemius at comcast.net> wrote: