-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
The current snippet crashes my r session when it gets to the last statement
library("data.table")
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] data.table_1.9.3
loaded via a namespace (and not attached):
[1] plyr_1.8.1 Rcpp_0.11.2 reshape2_1.4 stringr_0.6.2
[5] tools_3.1.1
dt <- data.table(id = c("A", "A", "B", "B", "C"),
start = structure(c(12894, 15706, 14153, 14533, 14539), class = "Date"),
end = structure(c(15705, 15763, 14532, 14578, NA_real_), class = "Date"),
key = "id")
sample <- c("A", "B")
dt[sample,
temp := c(start[-1L] - 1L, NA_real_),
by = .EACHI]
Can you reproduce it?