Skip to content
Back to formatted view

Raw Message

Message-ID: <13C64AC5-91C8-417B-AB53-8FACDFB9A126@gmail.com>
Date: 2009-03-13T18:40:27Z
From: Christopher David Desjardins
Subject: Unable to run smoother in qplot() or ggplot() - complains about knots
In-Reply-To: <f8e6ff050903130631i7c6aa638od315c26ea9f6d1f0@mail.gmail.com>

Thanks for the reply. I'll look into this.
Chris

On Mar 13, 2009, at 8:31 AM, hadley wickham wrote:

> On Thu, Mar 12, 2009 at 5:37 PM, Christopher David Desjardins
> <cddesjardins at gmail.com> wrote:
>> I get the following error when I run qplot()
>>
>> qplot(grade, read,data = hhm.long.m, geom = c("point", "smooth"))
>>
>> Error in smooth.construct.cr.smooth.spec(object, data, knots) :
>>  x has insufficient unique values to support 10 knots: reduce k.
>>
>> I am not sure how to tackle this problem. When I take a subsample  
>> (< 1000)
>> than I am able to run that function but with my sample of ~  40,000  
>> qplot
>> gives me that error. I have 6 grades.
>
> You have 6 values on the x-axis?  Maybe you want to just calculate the
> mean at each grade.  If so, see
> http://had.co.nz/ggplot2/stat_summary.html
>
> Hadley
>
> -- 
> http://had.co.nz/