Re: [R] help- subtitles for multiple charts
Thank you for your help, David. This is what I needed! -- View this message in context: http://r.789695.n4.nabble.com/help-subtitles-for-multiple-charts-tp3620453p3622926.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org 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.
[R] help- subtitles for multiple charts
Hello, I have a problem with my script. I don'y know how to apply subtitles. I have 9 charts per page (for combination of 3 blocks and 3 treatments). I want to have subtitles for this interaction (e.g. Block A Trt 1, Block A Trt 2, ...) MBE$bt- interaction(MBE$Block,MBE$trt) par(mfrow=c(3,3)) for(i in unique(MBE$bt)){ ss - MBE$bt==i plot(MBE$Year[ss], MBE$DBH[ss]) sm-loess(DBH~Year, data=pMBE[ss,]) x=seq(2004, 2010, by=1) points(x, predict(sm, data.frame(Year=x)), type=l) } It was possible for the command: MBE$trt.name- factor(MBE$trt, label=c(Treatment 1, Treatment 2, Treatment 3)) xyplot(MBE$DBH~MBE$Year|MBE$trt.name*MBE$Block, xlab=Year, ylab=DBH)- but I need it for the upper script, cuz the diagram is more appropriate. I would be grateful for any advise! -- View this message in context: http://r.789695.n4.nabble.com/help-subtitles-for-multiple-charts-tp3620453p3620453.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org 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.
Re: [R] help- subtitles for multiple charts
On Jun 23, 2011, at 1:00 PM, jalen wrote: Hello, I have a problem with my script. I don'y know how to apply subtitles. I have 9 charts per page (for combination of 3 blocks and 3 treatments). I want to have subtitles for this interaction (e.g. Block A Trt 1, Block A Trt 2, ...) MBE$bt- interaction(MBE$Block,MBE$trt) par(mfrow=c(3,3)) for(i in unique(MBE$bt)){ ss - MBE$bt==i plot(MBE$Year[ss], MBE$DBH[ss]) If this is working for you properly except for the subtitles ... Perhaps: plot(MBE$Year[ss], MBE$DBH[ss] sub=levels(MBE$bt)[i]) But I'm not sure you have properly separated the values of Year and DBH into categories of 'bt'. Perhaps that logical ss vector will work. Cannot tell in absence of data. sm-loess(DBH~Year, data=pMBE[ss,]) x=seq(2004, 2010, by=1) points(x, predict(sm, data.frame(Year=x)), type=l) } It was possible for the command: MBE$trt.name- factor(MBE$trt, label=c(Treatment 1, Treatment 2, Treatment 3)) xyplot(MBE$DBH~MBE$Year|MBE$trt.name*MBE$Block, xlab=Year, ylab=DBH)- but I need it for the upper script, cuz the diagram is more appropriate. I would be grateful for any advise! My advice: Post reproducible example. -- David Winsemius, MD West Hartford, CT __ R-help@r-project.org 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.
Re: [R] help- subtitles for multiple charts
http://r.789695.n4.nabble.com/file/n3620982/mbeFORUM.csv mbeFORUM.csv I uploaded my data and one more time the script (*adjusted version*): pMBE- MBE[MBE$left!=0,] pMBE$bt- interaction(pMBE$Block,pMBE$trt) par(mfrow=c(3,3), oma=c(2,0,2,0)) for(i in unique(pMBE$bt)){ ss - pMBE$bt==i plot(pMBE$Year[ss], pMBE$DBH[ss], xlab=Year, ylab=DBH [in], ylim=range(0:12), col=28) sm-loess(DBH~Year, data=pMBE[ss,]) x=seq(2004, 2010, by=1) points(x, predict(sm, data.frame(Year=x)), type=l, col=650, title(Diameter, adj=0.5, outer=T)) } -- View this message in context: http://r.789695.n4.nabble.com/help-subtitles-for-multiple-charts-tp3620453p3620982.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org 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.
Re: [R] help- subtitles for multiple charts
On Jun 23, 2011, at 4:41 PM, jalen wrote: http://r.789695.n4.nabble.com/file/n3620982/mbeFORUM.csv mbeFORUM.csv I uploaded my data and one more time the script (*adjusted version*): Try: pMBE- MBE[MBE$left!=0,] pMBE$bt- interaction(pMBE$Block,pMBE$trt) par(mfrow=c(3,3), oma=c(2,0,2,0)) for(i in unique(pMBE$bt)){ ss - pMBE$bt==i plot(pMBE$Year[ss], pMBE$DBH[ss], xlab=Year, ylab=DBH [in], ylim=range(0:12), col=28, sub=as.character(i) ) # add ^^ sm-loess(DBH~Year, data=pMBE[ss,]) x=seq(2004, 2010, by=1) points(x, predict(sm, data.frame(Year=x)), type=l, col=650, title(Diameter, adj=0.5, outer=T)) } David Winsemius, MD West Hartford, CT __ R-help@r-project.org 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.
Re: [R] help- subtitles for multiple charts
On Jun 23, 2011, at 10:40 PM, David Winsemius wrote: On Jun 23, 2011, at 4:41 PM, jalen wrote: http://r.789695.n4.nabble.com/file/n3620982/mbeFORUM.csv mbeFORUM.csv I uploaded my data and one more time the script (*adjusted version*): To get the Block and Trt text as in the original request (which you didn't copy for reference) you would use bquote: pMBE- MBE[MBE$left!=0,] pMBE$bt- interaction(pMBE$Block,pMBE$trt) par(mfrow=c(3,3), oma=c(2,0,2,0)) for(i in unique(pMBE$bt)){ ss - pMBE$bt==i; curlev - strsplit(as.character(i), ., fixed=TRUE) # also add ^^^ plot(pMBE$Year[ss], pMBE$DBH[ss], xlab=Year, ylab=DBH [in], ylim=range(0:12), col=28, sub= bquote(Block~.(curlev[[1]] [[1]])~Trt~.(curlev[[1]][[2]])) ) # add ^^ sm-loess(DBH~Year, data=pMBE[ss,]) x=seq(2004, 2010, by=1) points(x, predict(sm, data.frame(Year=x)), type=l, col=650, title(Diameter, adj=0.5, outer=T)) } David Winsemius, MD West Hartford, CT __ R-help@r-project.org 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. David Winsemius, MD West Hartford, CT __ R-help@r-project.org 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.