按照老师的程序输入为什么遇到了layout错误?
set.seed(1)
x <- rnorm(100)
f <- rep(0:1, each = 50)
y <- x + f - f*x + rnorm(100, sd = 0.5)
f <- factor(f, labels = c("Group1", "Group2"))
xyplot(y~x | f, layout(2,1))
然后为啥出现错误?
Error in layout(2, 1) : layout matrix must contain at least one reference to each of the values {1 ... 2}