Re: [R] Vertical bwplot and stripplot

From: David Winsemius <dwinsemius_at_comcast.net>
Date: Sat, 23 Apr 2011 09:47:27 -0400

On Apr 23, 2011, at 9:26 AM, David Neu wrote:

> Hi,
>
> I'd like to change the default orientation of bwplot() and stripplot()
> so the plots are displayed vertically. Passing horizontal=FALSE into
> stripplot in the simple code below doesn't seem to be the answer.
>
> library(lattice);
> x <- rnorm(100);
> y <- as.factor(sapply(1:100, function(k) sample(c("A","B","C"), 1,
> prob=c(1/2, 1/3, 1/6))));
> my.df <- data.frame(x=x, y=y);
> stripplot(~x | y, data=my.df, as.table=TRUE, layout=c(1,3), hor);

  1. hor is not defined
  2. it doesn't make sense to me to have the continuous variable as the independent variable here, despite if being named `x`.

Try:
stripplot(x~y , data=my.df, as.table=TRUE, layout=c(1,3), horizontal=FALSE);

(I didn't recognize the as.table argument, but experimentation seems to produce a top-down order to the plots.)

-- 
David Winsemius, MD
West Hartford, CT

______________________________________________
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.
Received on Sat 23 Apr 2011 - 13:49:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 23 Apr 2011 - 14:30:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive