R语言zoo包.docVIP

  • 174
  • 0
  • 约8.72万字
  • 约 16页
  • 2016-09-13 发布于河南
  • 举报
R语言zoo包

R语言zoo包 zoo包是R语言中对时间序列处理的基础包。 1)zoo函数 zoo(x = NULL, order.by = index(x), frequency = NULL) 其中:x:数据部分,可以为向量,矩阵,因子 order.by:索引部分,唯一字段,用于排序 frequency:每个时间单元显示的数量 #构造一个zoo对象,以时间为索引 x.Date - as.Date(2003-02-01) + c(1, 3, 7, 9, 14) x.Date [1] 2003-02-02 2003-02-04 2003-02-08 2003-02-10 2003-02-15 x.Date-1 [1] 2003-02-01 2003-02-03 2003-02-07 2003-02-09 2003-02-14 class(x.Date) [1] Date x-zoo(rnorm(5),x.Date) x 2003-02-02 2003-02-04 2003-02-08 2003-02-10 2003-02-15 0.4513341 -0.9607173 -0.8973593 1.1789152 -0.6684257 class(x) [1] zoo #以数学为索引的,多组时间序列 y-zoo(matrix(1:12,4,3),0:

文档评论(0)

1亿VIP精品文档

相关文档