Skip to content
Back to formatted view

Raw Message

Message-ID: <f8e6ff050809300735q783d1a79t4b44596f9427413b@mail.gmail.com>
Date: 2008-09-30T14:35:46Z
From: Hadley Wickham
Subject: ggplot, getting two scales and one stat.
In-Reply-To: <5aa355dd0809271421t5e556a7ak37517b15860da463@mail.gmail.com>

Hi Tylere,

This is a bug present in R 2.7.2 which will be fixed in the next
version (which I'm trying to release ASAP)

Hadley

On Sat, Sep 27, 2008 at 4:21 PM, Tylere Couture <tylerecouture at gmail.com> wrote:
> Thanks Hadley, unfortunately doing this gives me an error:
>
>> ggplot(polls, aes(x =Date, y = Popular_Support, colour=Party)) +
> + stat_smooth(span=0.5) +
> + geom_point(aes(shape=Source))
> Error in `[.data.frame`(df, , var) : undefined columns selected
>
> if I move it back up into ggplot, then it works fine.... ??
>
>
>
> 2008/9/27 hadley wickham <h.wickham at gmail.com>
>>
>> On Sat, Sep 27, 2008 at 1:08 AM, Tylere Couture <tylerecouture at gmail.com>
>> wrote:
>> > I have a simple plot:
>> >
>> > ggplot(polls, aes(x =Date, y = Popular_Support, colour=Party,
>> > shape=Source))
>> > +
>> > stat_smooth(span=0.5) +
>> > geom_point()
>> >
>> > How can I get the smooth to only render along one of the scales? ie, I
>> > want
>> > to see regressions for each colour, but not each shape.
>>
>> Just map shape to source only for the points:
>>
>> ggplot(polls, aes(x =Date, y = Popular_Support, colour=Party)) +
>> stat_smooth(span=0.5) +
>> geom_point(aes(shape=Source))
>>
>> Hadley
>>
>> --
>> http://had.co.nz/
>
>



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