用户
感谢@McQueenDon 在 r-nabble 上的回复
http://r.789695.n4.nabble.com/boxplot-with-x-axis-time-td4686787.html#a4687746
我设法生成了一个单一变量的 boxplot::base,其中 x 轴的格式正确并在采集日期间隔开。
如果我想用 bwplot::lattice 生成它怎么办?我需要这个,因为我还想使用条件因子。
这是一个可重复的示例(再次感谢@McQueenDon)
data(iris)
pippo= stack(iris[,-5])
pippo$date= rep(c("2013/01/29", "2013/03/01", "2013/11/01",
"2013/12/01", "2014/02/01", "2014/07/02"), 100)
pippo$date= as.Date(pippo$date)
boxplot(pippo$values ~ pippo$date) ## NOT exactly what I want
bx<- boxplot(pippo$values ~ pippo$date, plot= F)
bxp(bx, at=sort(unique(pippo$date))) # this is what I was looking for !
require(lattice)
bwplot(values~date, pippo, horizontal=F) #dates looks not correctly spaced even though they are correctly ordered and formatted
# finally I would like to condition to the 'ind' variable
bwplot(values~date| ind, pippo, horizontal=F, layout= c(2,2))
谢谢
朱塞佩