ts函数的第一个参数是观察值的向量或数组,将x$index改成x$values,其中values 写成数据中观察值的列名。参考https://blog.csdn.net/qq_27586341/article/details/90902732