-1
我试图打印随机行走时间序列,它非常简单,但尾部数据不会打印,年份显示为小数。R时间序列不绘制所有数据
library(astsa)
library(data.table)
x <- rnorm(104)
#Here it plots all points
plot.ts(x)
#Here it won't plot past Q2/March
x_ts<-ts(x, start = c(2014,1,1), end = c(2015,12,31), frequency = 52)
plot.ts(x_ts)
从数据框中,创建ts obj,如https://stat.ethz.ch/R-manual/R-devel/library/stats/html/ts.html – mlewis
感谢您的居高临下的建议。如果你不能帮助,请不要麻烦评论。如果其他人能够协助,我仍在寻求帮助。来自'?ts'的 – mlewis
:'start':第一次观察的时间。 **可以是单个数字或是两个整数的向量,它们将自然时间单位和(1为基数)个样本指定到时间单位**中。所以'c(2015,12,31)'意味着“到2015年的12周” - 不是你认为的意思 –