将POSIXct转换为字符时如何保留十进制值?
> t <- Sys.time()
> ct <- as.character(t)
> t - as.POSIXct(ct)
Time difference of 0.4370408 secs
上面的例子表明在将 POSIXct 转换为字符时精度会丢失。
转换为字符时如何保留确切值,以便当我从字符转换回 POSIXct 时获得原始值?
> t <- Sys.time()
> ct <- as.character(t)
> t - as.POSIXct(ct)
Time difference of 0.4370408 secs
上面的例子表明在将 POSIXct 转换为字符时精度会丢失。
转换为字符时如何保留确切值,以便当我从字符转换回 POSIXct 时获得原始值?