哪个R时间/日期类和包使用? [英] Which R time/date class and package to use?

查看:125
本文介绍了哪个R时间/日期类和包使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在R中有一个有限的时间序列曝光。所以,我想知道哪个时间/日期类(和相关包)最适合开始。



CRAN任务中包含的大量软件包视图,我至今赞成 timeDate ,这是一个S4导向,并且对位置相关的特殊性(如假日和夏令时)有很好的支持。



社群显然倾向于 zoo 包。 chron 也很受欢迎。



如果有多个套餐经验的人会分享他对可用时间的看法/日期课程在可用性和可扩展性方面进行比较。



某些兴趣点(以随机顺序):




  • 国际化(假期,时区等)

  • 可用的统计建模程序

  • 随时可用的可视化工具

  • 易用性

  • 与内置日期/时间序列类(POSIX,ts)的兼容性

  • 可扩展性(S4是希望)

  • 最适合与 lubridate



谢谢。

解决方案

(我把这个从评论移到答案根据原始海报的请求,stackoverflow的一部分。)



R News 4/1 (R Help Desk,p。 29)具体比较 Date POSIXct chron 。 (第二个是R的核心, chron 是一个包。)



timeDate 类(在 timeDate 包中)基于 POSIXct ,但具有额外的时区/金融中心支持。



对于定期间隔的系列, tis 包支持许多日期概念。



mondate 包支持会计日期。



zoo 时间序列包支持任何日期/时间类,还有 yearqtr ts 兼容性。



xts 时间序列包在 zoo 之上工作,并处理最常见的日期/时间类通过将它们转换为 POSIXct 并再次返回。



还有时间系列CRAN任务视图


I have a limited time series exposure in R. So, I wonder which time/date class (and associated package) would be most appropriate to start with.

Among the plethora of packages available at CRAN task view, I so far favor the timeDate, which is a S4 oriented and has nice support for location dependent particularities such as holidays and daylight saving times.

The community apparently favors the zoo package. chron is also popular.
[edit: Here is a list of time/date implementations which lubridate package refers to: POSIXct, OSIXlt, Date, chron, yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti, jul, timeSeries, fts. Also lubridate itself has handy time classes duration, period and interval.]

Would really appreciate if somebody with experience with multiple packages would share his opinion on how the available time/date classes compare in terms of usability and extensibility.

Some points of interest (in random order):

  • internationalization (holidays, timezones etc)
  • readily available statistical modeling procedures
  • readily available visualization tools
  • ease of use
  • compatibility with builtin date/time-series classes (POSIX,ts)
  • extensibility (S4 is desirable)
  • best to use with lubridate

Thanks.

解决方案

(I am moving this from the comments to the answer portion of stackoverflow at the request of the original poster.)

There is an article in R News 4/1 ("R Help Desk", p. 29) that specifically compares Date, POSIXct and chron. (The 1st two are in core of R and chron is a package.)

timeDate class (in the timeDate package) is based on POSIXct but has extra time zone/financial center support.

For regularly spaced series the the tis package supports many notions of dates.

The mondate package supports accounting dates.

The zoo time series package supports just about any date/time class and also has yearmon and yearqtr for ts compatibility.

The xts time series package works on top of zoo and handles the most common date/time classes by translating them to POSIXct and back again.

There is also information in the Time Series CRAN Task View.

这篇关于哪个R时间/日期类和包使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆