[Rcpp-devel] bug with DatetimeVector ?

stat quant statquant at outlook.com
Fri Jul 19 14:05:55 CEST 2013


Hello list, I might have found a bug, would you mind checking it too?

In R:

library("Rcpp")
sourceCpp("rcpp.cpp")
df = data.frame(x=c(1L,NA,2L),
dt=as.POSIXct(c(1L,NA,2L),origin='1970-01-01'))

df
   x                  dt
1  1 1970-01-01 00:00:01
2 NA                <NA>
3  2 1970-01-01 00:00:02

In C++

//[[Rcpp::export]]
void bug(DataFrame df){
    DatetimeVector dt = df["dt"];
}

Executing bug(df) in R crashes the R session on my box

sessionInfo()
R version 3.0.0 (2013-04-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=French_France.1252  LC_CTYPE=French_France.1252
 LC_MONETARY=French_France.1252 LC_NUMERIC=C                   LC_TIME=C

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base
other attached packages:
[1] Rcpp_0.10.4  vimcom_0.9-8
loaded via a namespace (and not attached):
[1] tools_3.0.0

Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130719/117ba7e3/attachment.html>


More information about the Rcpp-devel mailing list