【问题标题】:Box-and-Whisker plot grouped by year using R使用 R 按年份分组的盒须图
【发布时间】:2015-02-10 03:56:15
【问题描述】:

我在 R 中有时间序列对象,其中包含从 1949 年到 1960 年每个月的 AirPassenger 预订值。使用命令boxplot(AP ~ cycle(AP)) 可以轻松绘制按月分组的箱线图。如果我们必须按年份分组,我想知道如何做箱线图。

【问题讨论】:

    标签: r time-series boxplot


    【解决方案1】:

    帮助您入门的示例代码:

    ap   <- data.frame(AirPassengers)
    year <- rep(seq(1949,1960), rep(12,12))
    boxplot(ap$AirPassengers~year)
    

    【讨论】:

    • 非常感谢!正是我想要的:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-27
    • 2018-07-11
    • 1970-01-01
    相关资源
    最近更新 更多