Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up`shift` crashes R when using `n = "lead"` #3354
Comments
|
@SymbolixAU could you also provide
e043dd2 is not 1.12.0 but 1.12.1 |
|
@jangorecki sure thing This is the utils::sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.14.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] data.table_1.12.1 microbenchmark_1.4-4
loaded via a namespace (and not attached):
[1] compiler_3.5.1 tools_3.5.1 I've updated to the latest release and get the same error remove.packages("data.table")
install.packages("data.table", type = "source",
repos = "http://Rdatatable.github.io/data.table")
library(data.table)
dt <- data.table(
id = 1:5
, val = letters[1:5]
)
## This will crash RStudio
dt[, new_col := shift(val, "lead")]
devtools::session_info(pkgs = "data.table")
─ Session info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────
setting value
version R version 3.5.1 (2018-07-02)
os macOS 10.14.1
system x86_64, darwin15.6.0
ui RStudio
language (EN)
collate en_AU.UTF-8
ctype en_AU.UTF-8
tz Australia/Melbourne
date 2019-02-06
─ Packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
package * version date lib source
data.table * 1.12.1 2019-02-05 [1] local
[1] /Users/david/Library/R/3.5/library
[2] /Library/Frameworks/R.framework/Versions/3.5/Resources/library
|
While I'm aware this is incorrect use of the
shiftfunction, but if you forget to specify thetypeargument and useshift(val, "lead"), this causes Rstudio to crash.Reproducible example
Session info