[R] help- subtitles for multiple charts

David Winsemius dwinsemius at comcast.net
Thu Jun 23 20:41:27 CEST 2011


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



More information about the R-help mailing list