unlist(strptime("19300307", "%Y%m%d")) -6ren">
gpt4 book ai didi

r - strptime $mon 的日期函数问题在 R 中不起作用

转载 作者:行者123 更新时间:2023-12-04 10:40:05 25 4
gpt4 key购买 nike

谁能解释一下....

>strptime("19300307", "%Y%m%d")
"1930-03-07"
>unlist(strptime("19300307", "%Y%m%d"))
sec min hour mday mon year wday yday isdst
0 0 0 7 2 30 5 65 0

突然之间,我的 strptime 让我感到困惑......为什么 mon = 2 而不是 3?

最佳答案

按照我的评论,如果你阅读 ?DateTimeClasses,你会看到对于 POSIXlt 我们有:

0–11: months after the first of the year.

关于r - strptime $mon 的日期函数问题在 R 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10941004/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com