[R] ggplot2 - deprecated guide= argument in

Pedro Barros pedro.barros at fao.org
Thu Sep 18 08:53:51 CEST 2008


Hi Hadley,
As for now, I have not yet delved deep enough into the new version to be
sure if I like it or not. It's just that I like the freedom to choose, and
the previous form was great. Any chance you may put it back as an optional
parameter?
Thanks,
Pedro

hadley wrote:
> 
> On Wed, Sep 17, 2008 at 5:34 AM, Pedro Barros <pedro.barros at fao.org>
> wrote:
>>
>> In the help for scale_fill_identity, it is written
>>  ## Not run:
>>         colour <- c("red","green","blue","yellow")
>>         qplot(1:4, 1:4, fill=colour, geom="tile")
>>         qplot(1:4, 1:4, fill=colour, geom="tile") + scale_fill_identity()
>>
>>         # To get a legend, you also need to supply the labels to
>>         # be used on the legend, and the grob to draw them:
>>         # grob_tile, grob_line, or grob_point
>>         qplot(1:4, 1:4, fill=colour, geom="tile") +
>> scale_fill_identity(labels=letters[1:4], guide="tile", name="trt")
>>
>> This code used to work with ggplot2. However, after updating to the newer
>> version (version 0.6) and R 2.7.2, I get the following error message:
>> Error in get("new", env = ScaleIdentity, inherits = TRUE)(ScaleIdentity, 
>> :
>>  unused argument(s) (guide = "tile")
>>
>> If I omit the guide="tile" argument, I still get a tile, but I did like
>> the
>> option for choosing the grob to use.
>> How should I go about this?
> 
> You can no longer select the geom to use for drawing the legend - it's
> chosen automatically based on the geoms that you included in the plot.
>  Is there a geom in particular that you don't like the legend for?
> 
> Hadley
> 
> 
> -- 
> http://had.co.nz/
> 
> ______________________________________________
> 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.
> 
> 

-- 
View this message in context: http://www.nabble.com/ggplot2---deprecated-guide%3D-argument-in-tp19529294p19547030.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list