[R] trouble loading ggplot2 using R

R. Michael Weylandt michael.weylandt at gmail.com
Wed Apr 25 16:36:12 CEST 2012


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:
>
> 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 <hadley at rice.edu> 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]]
>>
>> ______________________________________________
>> R-help at r-project.org 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
>
>
> ______________________________________________
> R-help at r-project.org 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.



More information about the R-help mailing list