Quantcast

trouble loading ggplot2 using R

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

trouble loading ggplot2 using R

linsleyp
I'm having trouble loading ggplot2 on my mac (Snow Leopard) using R version 2.12.1, as shown below.  I can't find a posting relevant to this problem, so any help would be very much appreciated.  Thanks,

peter l



> install.packages('ggplot2', dep = TRUE)
trying URL 'http://cran.cnr.Berkeley.edu/bin/macosx/leopard/contrib/2.12/ggplot2_0.8.9.tgz'
Content type 'application/x-gzip' length 2481399 bytes (2.4 Mb)
opened URL
==================================================
downloaded 2.4 Mb


The downloaded packages are in
        /var/folders/XF/XF0tU7gdGTeF4Th7KhKYDk+++TI/-Tmp-//RtmpFMnqLB/downloaded_packages
> library(ggplot2)
Error in assign(names[i], dots[[i]], env = envir) :
  invalid first argument
Error : unable to load R code in package 'ggplot2'
Error: package/namespace load failed for 'ggplot2'
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trouble loading ggplot2 using R

ramonovelar
Hello,

I have a similar error, running R in Snow Leopard too

> library("ggplot2")
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trouble loading ggplot2 using R

Michael Weylandt
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 <[hidden email]> wrote:

> Hello,
>
> I have a similar error, running R in Snow Leopard too
>
>> library("ggplot2")
> 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.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trouble loading ggplot2 using R

ramonovelar
Hi, thanks for the answer.

Here is the output:

> sessionInfo()
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      
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trouble loading ggplot2 using R

Hadley Wickham-2
In reply to this post by ramonovelar
> I have a similar error, running R in Snow Leopard too
>
>> library("ggplot2")
> 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’

That's a completely different error.  Are you setting .Random.seed to
something non-standard?  That's what the error message suggests.

Hadley

--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trouble loading ggplot2 using R

ramonovelar
I don't think I have touched at anything at all. I'm very newbie to R and
to be honest I don't know what "Ramdom.seed" is. I will try to find out.

I have seen other messages about "restoring random.seed", but in order to
check that the problem is really that I have used some "Viewing data"
commands. The error says, in Spanish, that  ".Random.seed is not an integer
vector but a list" (.Random.seed no es un vector de números enteros pero es
de tipo 'list')

> class(.Random.seed)
[1] "data.frame"
> str(.Random.seed)
'data.frame': 626 obs. of  1 variable:
 $ .Random.seed: num  4.03e+02 1.00e+01 -1.28e+09 -1.40e+09 -1.06e+09 ..
> head(.Random.seed)
  .Random.seed
1          403
2           10
3  -1282779759
4  -1404015037
5  -1062445742
6    665436644
> tail(.Random.seed)
    .Random.seed
621   1369617214
622  -1673749493
623  -1883947891
624   1445895610
625   -903220232
626    970996181

On Tue, Apr 24, 2012 at 4:26 PM, Hadley Wickham <[hidden email]> wrote:

> > I have a similar error, running R in Snow Leopard too
> >
> >> library("ggplot2")
> > 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’
>
> That's a completely different error.  Are you setting .Random.seed to
> something non-standard?  That's what the error message suggests.
>
> Hadley
>
> --
> Assistant Professor / Dobelman Family Junior Chair
> Department of Statistics / Rice University
> http://had.co.nz/
>


--
==================================
Ramón Ovelar

        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trouble loading ggplot2 using R

Hadley Wickham-2
On Wed, Apr 25, 2012 at 6:27 AM, Ramon Ovelar <[hidden email]> wrote:
> I don't think I have touched at anything at all. I'm very newbie to R and to
> be honest I don't know what "Ramdom.seed" is. I will try to find out.
>
> I have seen other messages about "restoring random.seed", but in order to
> check that the problem is really that I have used some "Viewing data"
> commands. The error says, in Spanish, that  ".Random.seed is not an integer
> vector but a list" (.Random.seed no es un vector de números enteros pero es
> de tipo 'list')

That's definitely not what it should look like - you might want to
start from a fresh R workspace.

Hadley

--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trouble loading ggplot2 using R

David Winsemius
In reply to this post by ramonovelar

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

> I don't think I have touched at anything at all. I'm very newbie to  
> R and
> to be honest I don't know what "Ramdom.seed" is. I will try to find  
> out.
>
> I have seen other messages about "restoring random.seed", but in  
> order to
> check that the problem is really that I have used some "Viewing data"
> commands. The error says, in Spanish, that  ".Random.seed is not an  
> integer
> vector but a list" (.Random.seed no es un vector de números enteros  
> pero es
> de tipo 'list')
>
>> class(.Random.seed)
> [1] "data.frame"

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.

--
David.

>> str(.Random.seed)
> 'data.frame': 626 obs. of  1 variable:
> $ .Random.seed: num  4.03e+02 1.00e+01 -1.28e+09 -1.40e+09 -1.06e
> +09 ..
>> head(.Random.seed)
>  .Random.seed
> 1          403
> 2           10
> 3  -1282779759
> 4  -1404015037
> 5  -1062445742
> 6    665436644
>> tail(.Random.seed)
>    .Random.seed
> 621   1369617214
> 622  -1673749493
> 623  -1883947891
> 624   1445895610
> 625   -903220232
> 626    970996181
>
> On Tue, Apr 24, 2012 at 4:26 PM, Hadley Wickham <[hidden email]>  
> wrote:
>
>>> I have a similar error, running R in Snow Leopard too
>>>
>>>> library("ggplot2")
>>> 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’
>>
>> That's a completely different error.  Are you setting .Random.seed to
>> something non-standard?  That's what the error message suggests.
>>
>> Hadley
>>
>> --
>> Assistant Professor / Dobelman Family Junior Chair
>> Department of Statistics / Rice University
>> http://had.co.nz/
>>
>
>
>
> --
> ==================================
> Ramón Ovelar
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: trouble loading ggplot2 using R

Michael Weylandt
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 <[hidden email]> wrote:

>
> On Apr 25, 2012, at 8:27 AM, Ramon Ovelar wrote:
>
>> I don't think I have touched at anything at all. I'm very newbie to R and
>> to be honest I don't know what "Ramdom.seed" is. I will try to find out.
>>
>> I have seen other messages about "restoring random.seed", but in order to
>> check that the problem is really that I have used some "Viewing data"
>> commands. The error says, in Spanish, that  ".Random.seed is not an
>> integer
>> vector but a list" (.Random.seed no es un vector de números enteros pero
>> es
>> de tipo 'list')
>>
>>> class(.Random.seed)
>>
>> [1] "data.frame"
>
>
> 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.
>
> --
> David.
>
>>> str(.Random.seed)
>>
>> 'data.frame': 626 obs. of  1 variable:
>> $ .Random.seed: num  4.03e+02 1.00e+01 -1.28e+09 -1.40e+09 -1.06e+09 ..
>>>
>>> head(.Random.seed)
>>
>>  .Random.seed
>> 1          403
>> 2           10
>> 3  -1282779759
>> 4  -1404015037
>> 5  -1062445742
>> 6    665436644
>>>
>>> tail(.Random.seed)
>>
>>   .Random.seed
>> 621   1369617214
>> 622  -1673749493
>> 623  -1883947891
>> 624   1445895610
>> 625   -903220232
>> 626    970996181
>>
>> On Tue, Apr 24, 2012 at 4:26 PM, Hadley Wickham <[hidden email]> wrote:
>>
>>>> I have a similar error, running R in Snow Leopard too
>>>>
>>>>> library("ggplot2")
>>>>
>>>> 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’
>>>
>>>
>>> That's a completely different error.  Are you setting .Random.seed to
>>> something non-standard?  That's what the error message suggests.
>>>
>>> Hadley
>>>
>>> --
>>> Assistant Professor / Dobelman Family Junior Chair
>>> Department of Statistics / Rice University
>>> http://had.co.nz/
>>>
>>
>>
>>
>> --
>> ==================================
>> Ramón Ovelar
>>
>>        [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>
> David Winsemius, MD
> West Hartford, CT
>
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Loading...