Wolfram Fischer - Z/I/M
2004-Feb-12 09:12 UTC
[R] lattice: showing panels for factor levels with no values
How to show panels for factor levels of conditioning variables which do have no values? E.g. there are panels for "Grand Rapids" when they have values: data( barley ) with( barley, dotplot(variety ~ yield | year * site, layout=c(6,2) ) ) There are no panels for "Grand Rapids" when there are no values for "Grand Rapids": my.barley <- subset( barley, ! ( site == "Grand Rapids" ) ) with( my.barley, dotplot(variety ~ yield | year * site, layout=c(6,2) ) ) But there is a level "Grand Rapids": levels( my.barley$site ) [1] "Grand Rapids" "Duluth" [3] "University Farm" "Morris" [5] "Crookston" "Waseca" Is there an option to show empty panels for "Grand Rapids" in ``my.barley''? Thanks. Wolfram
Deepayan Sarkar
2004-Feb-12 13:11 UTC
[R] lattice: showing panels for factor levels with no values
On Thursday 12 February 2004 03:12, Wolfram Fischer - Z/I/M wrote:> How to show panels for factor levels of conditioning variables > which do have no values? > > E.g. there are panels for "Grand Rapids" when they have values: > data( barley ) > with( barley, dotplot(variety ~ yield | year * site, layout=c(6,2) ) ) > > There are no panels for "Grand Rapids" > when there are no values for "Grand Rapids": > my.barley <- subset( barley, ! ( site == "Grand Rapids" ) ) > with( my.barley, dotplot(variety ~ yield | year * site, layout=c(6,2) ) ) > > But there is a level "Grand Rapids": > levels( my.barley$site ) > [1] "Grand Rapids" "Duluth" > [3] "University Farm" "Morris" > [5] "Crookston" "Waseca" > > Is there an option to show empty panels for "Grand Rapids" in > ``my.barley''?No, unused factor levels are dropped. I'll see if adding an option for this is feasible. Deepayan
Dieter Menne
2004-Feb-13 13:18 UTC
[R] lattice: showing panels for factor levels with no values
Wolfram Fischer wrote (> Is there an option to show empty panels for "Grand Rapids" in > ``my.barley''?Deepayan No, unused factor levels are dropped. I'll see if adding an option for this is feasible. Dieter Menne: See also http://maths.newcastle.edu.au/~rking/R/help/01c/2820.html Deepayan, at that time I received an e-mail (not in the archives) from you saying that this feature was already in the code, but not yet active (quoted from memory). Dieter Menne