运行这些时出错:
library(lubridate)
dmy_hm("3/10/2010 2:00",tz="Australia/Melbourne")
dmy_hm("2/10/2011 2:00",tz="Australia/Melbourne")
只是我吗?
答案 0 :(得分:3)
问题是夏令时,从这些时间点开始。此时区不存在2010年3月10日2:00到3/10/2010 2:59之间的任何内容。
library(lubridate)
dmy_hm("3/10/2010 1:59",tz="Australia/Melbourne")
#[1] "2010-10-03 01:59:00 EST"
dmy_hm("3/10/2010 2:00",tz="Australia/Melbourne")
#Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
#Error during wrapup: evaluation nested too deeply: infinite recursion / options(expressions=)?
dmy_hm("3/10/2010 2:01",tz="Australia/Melbourne")
#Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
#Error during wrapup: evaluation nested too deeply: infinite recursion / options(expressions=)?
dmy_hm("3/10/2010 2:59",tz="Australia/Melbourne")
#Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
#Error during wrapup: evaluation nested too deeply: infinite recursion / options(expressions=)?
dmy_hm("3/10/2010 3:00",tz="Australia/Melbourne")
#[1] "2010-10-03 03:00:00 EST"
但是,lubridate应该优雅地处理这个问题,例如,返回NA
。
答案 1 :(得分:1)
我收到错误
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
使用traceback()
,发生错误时的调用堆栈如下所示
...
10: .local_parse(x[new_na])
9: .local_parse(x[new_na])
8: .local_parse(x[new_na])
7: .local_parse(x[new_na])
6: .local_parse(x[new_na])
5: .local_parse(x[to_parse], TRUE)
4: parse_date_time(dates, orders, tz = tz, locale = locale, quiet = quiet)
3: as.POSIXct(parse_date_time(dates, orders, tz = tz, locale = locale,
...
2: .parse_xxx_hms(..., orders = "dmyR", quiet = quiet, tz = tz,
...
1: dmy_hm("2/10/2011 2:00", tz = "Australia/Melbourne")
所以这是.local_parse
中的一个错误,它在parse_date_time
中定义。您可以在此处提交错误报告: