[R] strip.custom() with more than one conditioning variable

Duncan Mackay mackay at northnet.com.au
Fri Nov 16 00:29:43 CET 2012


Hi Patrick

Not sure what you finally want to achieve but will this do?

I have reduced the size of the text to make them readible

  dotplot(variety ~ yield | year+ site, barley,
             strip = strip.custom(which.given = 2, style = 4,
                           factor.levels = paste(levels(barley$year), 
substring(levels(barley$site), 1, 1)),
                           par.strip.text = list(cex = 0.75))
)

Regards

Duncan


Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: mackay at northnet.com.au



At 06:53 16/11/2012, you wrote:
>Suppose I wanted to plot the barley data like this:
>
>     dotplot(variety ~ yield | year+ site, barley,
>             strip = strip.custom(style = 4))
>
>The factor levels are far too long for that to be useful.  I can
>overcome that problem if I shorten the levels like this:
>
>     dotplot(variety ~ yield | year + site, barley,
>             strip = strip.custom(style = 4,
>               factor.levels =  substring(levels(barley$site), 1, 1)))
>
>But that messes up the year levels.  So I try to have it influence
>only the site levels:
>
>     dotplot(variety ~ yield | year+ site, barley,
>             strip = strip.custom(which.given = 2, style = 4,
>               factor.levels =  substring(levels(barley$site), 1, 1)))
>
>But then the year strip is omitted altogether.  How do I specify
>a different list for different which.given numbers?
>
>In this case, I know I could simply redefine the levels in the factor
>but that's not an option where I wish to apply this method.
>
>TIA
>Patrick
>
>______________________________________________
>R-help at 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.




More information about the R-help mailing list