首页 > 解决方案 > plot.ts 下标越界错误

问题描述

我正在尝试使用 plot.ts 绘制时间序列图,但Error in dn[[2L]] : subscript out of bounds发生了错误....

revenue_quar <- c(17.37094, 15.58824, 23.79257, 15.44293, 24.75871, 28.68056, 24.32584, 25.59313, 34.66942, 19.94382, 22.35166, 32.10879, 18.76543, 25.99338, 30.31429, 22.81155, 28.05085, 30.76923, 33.29787, 19.04181, 18.00000, 41.07843, 28.94161, 35.35533, 35.46053, 25.79848, 40.41284, 38.00341, 32.37024, 51.25000, 26.57895, 21.40000, 45.84746, 48.42466, 46.99063, 47.20994, 45.12469, 33.32117, 32.36655, 30.24096, 34.58944, 42.74405, 35.49383, 34.76802, 42.01131, 42.47948, 39.83083, 41.15385)
revenue_quar_ts <- ts(revenue_quar, frequency=4, start=c(2004,4))
plot.ts <- revenue_quar_ts

我已经阅读了zx8754的解决方案,但仍然不能真正理解它......你能告诉我修复这个错误的解决方案吗?谢谢!

标签: rplottime-series

解决方案


推荐阅读