Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我试图为不同的向量长度制作一个 bwplot(它必须是来自 Lattice 的 bwplot)。
xx1 <- rnorm(20, mean = 3, sd = 3.6) #20 xx2 <- rpois(40, lambda = 3.5) xx3 <- rchisq(31, df = 5, ncp = 0) #31
data.frame一旦你用你的三个组创建了一个,这更容易做到:
data.frame
library(lattice) df <- data.frame(x=c(xx1, xx2, xx3), group=factor(c(rep("xx1", length(xx1)), rep("xx2", length(xx2)), rep("xx3", length(xx3))))) bwplot(x~group, df)