【发布时间】:2015-02-10 03:56:15
【问题描述】:
我在 R 中有时间序列对象,其中包含从 1949 年到 1960 年每个月的 AirPassenger 预订值。使用命令boxplot(AP ~ cycle(AP)) 可以轻松绘制按月分组的箱线图。如果我们必须按年份分组,我想知道如何做箱线图。
【问题讨论】:
标签: r time-series boxplot
我在 R 中有时间序列对象,其中包含从 1949 年到 1960 年每个月的 AirPassenger 预订值。使用命令boxplot(AP ~ cycle(AP)) 可以轻松绘制按月分组的箱线图。如果我们必须按年份分组,我想知道如何做箱线图。
【问题讨论】:
标签: r time-series boxplot
帮助您入门的示例代码:
ap <- data.frame(AirPassengers)
year <- rep(seq(1949,1960), rep(12,12))
boxplot(ap$AirPassengers~year)
【讨论】: