[R] Problem with geom_line

hadley wickham h.wickham at gmail.com
Wed Jan 23 12:20:06 CET 2008


On Jan 23, 2008 3:29 AM, Pilar Loren <pilar.loren at gmail.com> wrote:
> Hi!, I need help, I have a problem with geom_line function because I have
> this error:
>
> > df
>        LENGTH      LAT
> 091639 10.002 42.26282
> 091640 30.808 42.26834
> 091641 21.591 42.31689
> 091642 22.030 41.53246
> 091643 22.744 42.01954
> 091644 12.702 42.67751
> 091645 39.728 42.06479
> 091647 63.057 41.25283
> 091648 19.523 41.01925
> 091649 13.336 42.46904
> 091650  8.935 42.80971
> 091651 25.275 42.50678
> 091652  9.983 42.89345
> 091653  9.416 41.15288
>
> > df <- data.frame(doc$data())
> > p<- ggplot(df)
> > p<-p + geom_line(aes(x = rownames(df), y = LENGTH), size=1.0,
> colour="blue", linetype=1)
> > p
> Error en do.call("gList", panels) : second argument must be a list
>
> I don't understan why this occurs? Any idea?

It's hard to say without your exact data.  However, I'd try making the
rownames a proper variable - df$id <- rownames(df) - and using that
instead.  ggplot assumes that all your data is stored in a data frame.
 If that doesn't work, please use dput to provide your data in a way
that's easy for us to get at.

Hadley

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



More information about the R-help mailing list