I updated/reinstalled ggplot2 and the trouble started...

50 views
Skip to first unread message

tena

unread,
May 5, 2009, 7:27:04 PM5/5/09
to ggplot2
Hi Folks,

I am pretty new to R and I am even newer to ggplot.

I am using R 2.7.1, 2.8.1, and 2.9.0 on linux host and
what I am experiencing holds for all three.

I was just typing a few examples from the chapter 2 of
the book, ggplot2 --Elegant graphics for data analysis.

I typed 3 qplot lines on page 13:
> qplot (carat, price, data=diamonds, slpha = i(1/10))
> qplot (carat, price, data=diamonds, slpha = i(1/100))
> qplot (carat, price, data=diamonds, slpha = i(1/200))

To me, the plot looked identical. I went to my R library
directory and looked at the date on the ggplot2 directory,
which was April of 2008. I decided to update the library.
In R, I issued:
> install.packages ('ggplot2', '/usr/local/Gallo/R')
and there was a complaint as to permission denied for
saving the current version (or something). I reissued
the command as root and this time it gave me a normal
return.

I was ready to retrace my steps with the book. I only got
to page 11 this time. Here's what happened (in all three
versions):
> set.seed (1410)
> dsmall <- diamonds [sample (nrow(diamonds), 100), ]
>
> qplot (carat, price, data = diamonds)
Error in get("new", env = FacetGrid, inherits = TRUE)
(FacetGrid, ...) :
could not find function "is.formula"
>

Can somebody please clue me in as to what's happening,
what I am doing wrong, etc?

Regards,

Tena Sakai
tsa...@gallo.ucsf.edu

hadley wickham

unread,
May 5, 2009, 8:24:06 PM5/5/09
to tena, ggplot2
Hi Tena,

R isn't very good at detecting when package dependencies also need to
be updated, so you probably need to do:

install.packages(c("reshape","plyr"))

And you want

qplot (carat, price, data=diamonds, alpha = I(1/10))

not

qplot (carat, price, data=diamonds, slpha = i(1/10))

Hadley
--
http://had.co.nz/

tena

unread,
May 6, 2009, 2:13:24 AM5/6/09
to ggplot2, tsa...@gallo.ucsf.edu
Hi Hadley,

Many thanks for your reply.

I followed your instruction and got past the point where I
was stuck at. Namely, I was able to generate a few plots.
But as I came to the second half of section 2.4, where I
wanted to see the behavior of alpha paramter, which I
had apparently misspelled, I encountered another hindrance:
> qplot (carat, price, data = diamonds, alpha = I(1/10))
Warning message:
In grid.Call.graphics("L_points", x$x, x$y, x$pch, x$size) :
semi-transparency is not supported on this device: reported only
once per page

A plot was generated, but there are tic marks and labels on
each direction, but no plot at all.

I wonder if this is yet another (hidden) package to be updated...
The warning message suggests grid, but I am hesitant to do
something without knowing what is what. I would appreciate
your instruction.

Regards,

Tena Sakai

Tobias Verbeke

unread,
May 6, 2009, 4:32:00 AM5/6/09
to hadley wickham, tena, ggplot2
hadley wickham wrote:

> R isn't very good at detecting when package dependencies also need to
> be updated, so you probably need to do:
>
> install.packages(c("reshape","plyr"))

I never experienced R wasn't good at detecting this.

On the other hand, if a new version of a package relies
on a new version of another one, it should be stated
using explicit versions in the "Depends:" field.

It is a different thing to depend on a package and
to depend on a specific (sufficiently recent) version
of a package. I notice reshape does not have such
a 'versioned dependency' on plyr, which might cause
the problems.

Best,
Tobias

hadley wickham

unread,
May 6, 2009, 8:39:24 AM5/6/09
to Tobias Verbeke, tena, ggplot2
> It is a different thing to depend on a package and
> to depend on a specific (sufficiently recent) version
> of a package. I notice reshape does not have such
> a 'versioned dependency' on plyr, which might cause
> the problems.

I missed it in this version of ggplot2, but in every previous version
I've depended on the correct version of plyr. It doesn't help.

Hadley


--
http://had.co.nz/

Tobias Verbeke

unread,
May 6, 2009, 9:48:30 AM5/6/09
to hadley wickham, tena, ggplot2

Ah. Apologies. I did not have such experience in the past
and remember having been warned against old versions of
dependencies for other packages, although I'm not sure
anymore whether it was at 'load time' or 'install time'.
I agree it is a pity R's behaviour is not yet right in
this respect.

Best,
Tobias

tena

unread,
May 7, 2009, 12:22:29 AM5/7/09
to ggplot2
Hi folks,

Per Ian Fellow's suggestion, I reinstalled R 2.9.0, then
I reinstalled ggplot2 on top. The problem persists.

Here's the what happens after the installation:

> qplot (carat, price, data = diamonds, alpha = I(1/10))
Warning message:
In grid.Call.graphics("L_points", x$x, x$y, x$pch, x$size) :
semi-transparency is not supported on this device: reported only
once per page

I get a plot with labels with ticks in each direction, but
otherwise the plot is blank.

With google group I don't know how to attach a file,
but I will post the same message to R mailing list. I
do know how to attach the file and my record of what
I have done is documented in the attached file. I would
think this should be reproducible with anybody else.

If you have any other suggestion, I am all ears.

Regards,

Tena Sakai
tsa...@gallo.ucsf.edu

hadley wickham

unread,
May 7, 2009, 2:50:00 AM5/7/09
to tena, ggplot2
Well, the warning is pretty explicit:

In grid.Call.graphics("L_points", x$x, x$y, x$pch, x$size) :
semi-transparency is not supported on this device: reported only
once per page

The question is which graphics device are you using that doesn't
support transparency? i.e. what platform are you on?

Hadley
--
http://had.co.nz/

tena

unread,
May 7, 2009, 3:09:54 AM5/7/09
to ggplot2
Hi Hadley,

I am on linux (redhat 4).
I wonder if this is dependent on the X server I am using,
which is XDarwin.

Maybe I should ignore this particular line and move on.

Regards,

Tena Sakai
tsa...@gallo.ucsf.edu
Reply all
Reply to author
Forward
0 new messages