Closed statquant closed 4 years ago
Also tested with latest from cran and got the same issue
Thank you for bringing it to my attention. It will be fixed in the next version. In the mean time, you can temporarily fix the issue with e.g.:
library(nanotime)
library(data.table)
z <- data.table(x=nanotime(100))
qsave(z, file="/tmp/temp.z")
q <- qread("/tmp/temp.z")
q$x <- asS4(q$x)
print(q)
x
1: 1970-01-01T00:00:00.000000100+00:00
Great
Many thanks
Just for other people, q$s = asS4(q$x)
would trigger a copy of the data.table, the following would work for arbitrary number of nanotime columns
cols = sapply(q, FUN = function(x) class(x) %in% c("nanotime"))
cols = colnames(q)[cols]
if(length(cols) > 0L)
q[,(cols) := lapply(.SD, FUN = asS4), .SDcols = cols]
Cool, if you don't mind I'll keep it open in case other people have the same issue they can see it.
Should be fixed with ver 0.20.1 on github and hopefully on CRAN soon). :)
Hello there seem to be a bug when saving nanotimes in data.tables I am using qs_0.13.1
If that helps the same thing works using fst