【问题标题】:How to make a bwplot for different vectors lenght如何为不同的向量长度制作箱线图
【发布时间】:2016-04-09 10:47:25
【问题描述】:

嗨,我试图为不同的向量长度制作一个 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

【问题讨论】:

    标签: r bwplot


    【解决方案1】:

    一旦您为三个组创建了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)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-21
      • 2013-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多