Christopher Philipson
2005-Aug-12 01:23 UTC
[R] strips according to groups in xYplot or xyplot
Dear all, using the follwing code, i have been trying group the individual plots from trellis graphics according to genus. adding a groups=genus colours the lines on the individual plots accordingly. However, i need the strips to be coloured according to genus with the lines in each plot remaining black. using xyplot and conditioning to genus and species light|species+genus draws an extra strip with the genus name, this almost there, but then i have lots of blanc plots for all the nonexistant genus species conbinations - and also i wish to retain my error bars from xYplot. I understand that the solution is probably making my own strip function, but this is a little beyond my programming skills. Does anyone have any similar examples? an example dataframe is pasted below Many thanks Chris xYplot(Cbind(rgr.biomass,rgr.biomass-se,rgr.biomass+se) ~ light|species, data=data2, between=list(x=c(0.3,0.3,0.3,0.3,0.3),y=c(0.3,0.3,0.3)), type=c("l"), col.line="black",ylab= "rgr biomass (g-day-1)", xlab="% light in nursery", main="Relative Growth rates of Diperocarps in three simulated light conditions", par.strip.text=list(cex=0.9, font=3),par.settings=list(axis.text=list(cex=0.7)),layout=c(6,4), grid=T) genus light rgr.biomass species se conformis.0.3 Dipterocarpus 0.3 0.0071360017 conformis 0.0005639106 conformis.3 Dipterocarpus 3.0 0.0114787998 conformis 0.0005139212 conformis.18 Dipterocarpus 18.0 0.0128981690 conformis 0.0007443577 beccarii.0.3 Dryobalanops 0.3 0.0043183235 beccarii 0.0008404544 lanceolata.0.3 Dryobalanops 0.3 0.0037914641 lanceolata 0.0012840799 beccarii.3 Dryobalanops 3.0 0.0086008217 beccarii 0.0007029627 lanceolata.3 Dryobalanops 3.0 0.0066640135 lanceolata 0.0010293987 beccarii.18 Dryobalanops 18.0 0.0113213323 beccarii 0.0014422309 lanceolata.18 Dryobalanops 18.0 0.0107687387 lanceolata 0.0014388931 nervosa.0.3 Hopea 0.3 -0.0009249978 nervosa 0.0018732192 sangal.0.3 Hopea 0.3 0.0019374847 sangal 0.0007375358 spp.0.3 Hopea 0.3 0.0086367776 spp 0.0004649476 nervosa.3 Hopea 3.0 0.0028767234 nervosa 0.0006551664 sangal.3 Hopea 3.0 0.0056669364 sangal 0.0005872821 spp.3 Hopea 3.0 0.0118224681 spp 0.0005562180 nervosa.18 Hopea 18.0 0.0016949373 nervosa 0.0016615030 sangal.18 Hopea 18.0 0.0041026605 sangal 0.0018584946 spp.18 Hopea 18.0 0.0114581095 spp 0.0012815084 malaanonan.0.3 Parashorea 0.3 0.0055797534 malaanonan 0.0007918039 tomentella.0.3 Parashorea 0.3 0.0123015741 tomentella 0.0008293033 malaanonan.3 Parashorea 3.0 0.0099503268 malaanonan 0.0006376027 tomentella.3 Parashorea 3.0 0.0155581595 tomentella 0.0006379742 malaanonan.18 Parashorea 18.0 0.0092196940 malaanonan 0.0017303947 tomentella.18 Parashorea 18.0 0.0163406724 tomentella 0.0013648430 argentifolia.0.3 Shorea 0.3 0.0083378142 argentifolia 0.0010850323 beccariana.0.3 Shorea 0.3 0.0070930251 beccariana 0.0004610866 faguetiana.0.3 Shorea 0.3 0.0045384372 faguetiana 0.0010002449 gibbosa.0.3 Shorea 0.3 0.0120252725 gibbosa 0.0015315410 guiso.0.3 Shorea 0.3 0.0016886809 guiso 0.0004390734 johorensis.0.3 Shorea 0.3 0.0046130010 johorensis 0.0013987125 leprosula.0.3 Shorea 0.3 0.0054931197 leprosula 0.0007935381 macrophylla.0.3 Shorea 0.3 0.0071376385 macrophylla 0.0006889700 macroptera.0.3 Shorea 0.3 0.0044181634 macroptera 0.0005528986 oleosa.fallax.0.3 Shorea 0.3 0.0045416334 oleosa.fallax 0.0004696663 ovalis.0.3 Shorea 0.3 0.0021653329 ovalis 0.0014667085 parvifolia.0.3 Shorea 0.3 0.0031730144 parvifolia 0.0002314153 parvistipulata.0.3 Shorea 0.3 0.0108939901 parvistipulata 0.0007272541 superba.0.3 Shorea 0.3 0.0048611998 superba 0.0005558181 argentifolia.3 Shorea 3.0 0.0130474184 argentifolia 0.0005603928 beccariana.3 Shorea 3.0 0.0116513374 beccariana 0.0006809518 faguetiana.3 Shorea 3.0 0.0056884859 faguetiana 0.0024317150 gibbosa.3 Shorea 3.0 0.0163350328 gibbosa 0.0008753554 guiso.3 Shorea 3.0 0.0039323112 guiso 0.0008966266 johorensis.3 Shorea 3.0 0.0057245098 johorensis 0.0012002584 leprosula.3 Shorea 3.0 0.0110078404 leprosula 0.0006868679 macrophylla.3 Shorea 3.0 0.0115086497 macrophylla 0.0006057665 macroptera.3 Shorea 3.0 0.0083571394 macroptera 0.0004631552 oleosa.fallax.3 Shorea 3.0 0.0087806875 oleosa.fallax 0.0006363115 ovalis.3 Shorea 3.0 0.0048820034 ovalis 0.0014104024 parvifolia.3 Shorea 3.0 0.0078921667 parvifolia 0.0004507610 parvistipulata.3 Shorea 3.0 0.0148271032 parvistipulata 0.0005077023 superba.3 Shorea 3.0 0.0085652932 superba 0.0010371722 argentifolia.18 Shorea 18.0 0.0132702301 argentifolia 0.0016208120 beccariana.18 Shorea 18.0 0.0109954252 beccariana 0.0006496374 faguetiana.18 Shorea 18.0 0.0049321550 faguetiana 0.0008261597 gibbosa.18 Shorea 18.0 0.0188341938 gibbosa 0.0008460866 guiso.18 Shorea 18.0 0.0065560144 guiso 0.0013176760 johorensis.18 Shorea 18.0 0.0057575280 johorensis 0.0014724596 leprosula.18 Shorea 18.0 0.0156544894 leprosula 0.0006584250 macrophylla.18 Shorea 18.0 0.0111129238 macrophylla 0.0004117240 macroptera.18 Shorea 18.0 0.0097310849 macroptera 0.0003881022 oleosa.fallax.18 Shorea 18.0 0.0089809752 oleosa.fallax 0.0003670370 ovalis.18 Shorea 18.0 0.0062264658 ovalis 0.0009884059 parvifolia.18 Shorea 18.0 0.0078973351 parvifolia 0.0011538826 parvistipulata.18 Shorea 18.0 0.0159302434 parvistipulata 0.0004134491 superba.18 Shorea 18.0 0.0097285994 superba 0.0007884945 -- =======================================Mr Christopher D. Philipson, PhD Student, University of Z??rich, Institute for Environmental Sciences, Winterthurstrasse 190 CH - 8057 Z??rich Tel: +41 44 635 6129 Fax: +41 44 635 5711