Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shift case of crash R session #1009

Closed
jangorecki opened this issue Jan 15, 2015 · 0 comments
Closed

shift case of crash R session #1009

jangorecki opened this issue Jan 15, 2015 · 0 comments
Assignees
Labels
Milestone

Comments

@jangorecki
Copy link
Member

Not sure but I assume below should work. Field time_code is unique Date.
Latest master currently crash R session in the below case:

library(data.table)
DT <- data.table(
  time_code = structure(c(15436, 15437, 15438, 15439, 15440), class = "Date"),
  value = c(712242.20376462, 608841.4513506, 182544.2945119, 872201.29650086, 352442.92207062)
)
DT[, c("value_lead_2") := shift(value, n=2, fill=NA, type="lead", give.names=FALSE), by=c("time_code")]

session

R version 3.1.2 (2014-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_DK.UTF-8        LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=C             
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] data.table_1.9.5

loaded via a namespace (and not attached):
[1] bitops_1.0-6   chron_2.3-45   devtools_1.6.1 httr_0.6.1     RCurl_1.95-4.5 stringr_0.6.2  tools_3.1.2   
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants