Re: [R] Question concerning ggplot

From: Rainer M Krug <RKrug_at_sun.ac.za>
Date: Tue 24 Oct 2006 - 14:28:51 GMT

hadley wickham wrote:
>> > rsqs <- as.data.frame(stamp(mtcars, cyl ~ ., function(df)
>> > summary(lm(mpg ~ wt, data=df))$r.squared))
>> > rsqs$wt <- 4
>> > rsqs$mpg <- 32
>> > ggtext(p, data=rsqs, aes=list(label=value))
>> >
>> > But that doesn't work for some reason I don't understand yet (but I'm
>> > working on it)

> 
> Ooops - I just had the wrong version of reshape installed.  It should
> work with the version available on cran.

Thanks again for the example - but I don't seem to be able to get it to work in my context:

 > p <- ggplot(tc, . ~ expert, aesthetic=list(y=x0050, x=generation))
 > ggjitter(p)
 > ggsmooth(method=lm)
 > rsqs <- as.data.frame( stamp( tc, expert ~ ., function(df) 
summary(lm(x0050 ~ generation, data=df))$r.squared))  > rsqs
   expert     value
1     BW 0.9056925
2     DM 0.9280401
3     DR 0.8044774
4     JH 0.7531401
5   Mean 0.9452478
6     TG 0.8816820

 > ggtext(data=rsqs, aesthetics=list(label=value, x=1, y=8000)) Error in data.frame(data[, c(variables), drop = FALSE], result = data$value) :

        arguments imply differing number of rows: 6, 0  >

Can you give me a hint what I am doing wrong?

Rainer

>
> Hadley

-- 
Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation
Biology (UCT)

Department of Conservation Ecology and Entomology
University of Stellenbosch
Matieland 7602
South Africa

Tel:		+27 - (0)72 808 2975 (w)
Fax:		+27 - (0)21 808 3304
Cell:		+27 - (0)83 9479 042

email:	RKrug@sun.ac.za
       	Rainer@krugs.de

______________________________________________
R-help@stat.math.ethz.ch 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.
Received on Wed Oct 25 10:12:07 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 25 Oct 2006 - 01:30:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.