In my code below tempa and tempb are numeric vectors that I combined
into a dataframe along with the deciles of tempa.
I have an lapply statement that goes through the dataframe and does ten
plots according to the appropriate decile.
The code is below and it works fine. There are no bugs so I figure there
was no need to include structure statements on the data.
Also, I don't want to use coplot because the axes get sort of messed up
because of outliers.
tempa.deciles<-cut(tempa,breaks=quantile(tempa,probs=seq(0,1,0.1)),inclu
de.lowest=TRUE)
df<-data.frame(tempa,tempb,tempa.deciles)
levels(df$tempa.deciles)<-paste("Decile ",1:10,sep="")
lapply(split(df, df$tempa.deciles), function(x) {
print(cor(x$tempa,x$tempb)); plot(x$tempa,x$tempb);
I would like to include a title on each plot so that I can recognize
which plot goes with which decile but I don't
know how to do that basically because I can't figure out what lapply is
looping over by number. I definitely
looked around in various R books but I was not successful. Thanks for
your help.
--------------------------------------------------------
This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}
______________________________________________
[email protected] 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.