我正在尝试安装POSIXlt包,我得到以下结果。我在Mac和Windows上都试过了。
包'POSIXlt'不可用(对于R版本3.0.1)
有什么想法吗?我认为这个包可用于3.0.1。我是否需要加载早期版本的R(哪一个)?它并不理想,因为我想使用一些较新的包。 谢谢
答案 0 :(得分:3)
它是由基础R 提供的类。如果你有R,那么你有POSIXlt
。
从当前日期开始:
R> unlist(as.POSIXlt(Sys.Date()))
sec min hour mday mon year wday yday isdst
0 0 0 3 7 113 6 214 0
R>
从当前时间开始:
R> unlist(as.POSIXlt(Sys.time()))
sec min hour mday mon year wday yday isdst
28.99 27.00 12.00 3.00 7.00 113.00 6.00 214.00 1.00
R>
如果没有unlist()
,输出将被格式化(“漂亮打印”)。