From diy at stat.oregonstate.edu  Fri Apr 29 23:54:09 2016
From: diy at stat.oregonstate.edu (diy at stat.oregonstate.edu)
Date: Fri, 29 Apr 2016 14:54:09 -0700
Subject: [Rd] boxplot with formula involving two-factor levels
Message-ID: <A0910CA43C834C6FB03CE582BBA660D3@science.oregonstate.edu>

Hi,

I noticed two seemingly equivalent call to boxplot will give different plots (in the way how the combined factor levels are arranged on the x-axis): 

x = factor(rep(c("a", "b", "c"), each=2));
y = rep(factor(c("one", "two")), each=3);
r = 3;
n = r * 6;
x = rep(x, 3);
y = rep(y, 3);
z = rnorm(n);

par(mfrow=c(2,1));

## The following two seeming equivalent calls to boxplot give different results
boxplot(z~x:y);

f = x:y;
boxplot(z~f);

This is puzzling to me. Is this normal? 

Thanks!

Best,
Yanming
	[[alternative HTML version deleted]]



[Rd] boxplot with formula involving two-factor levels
diy at stat.oregonstate.edu