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

Crashing Rstudio when combining J(), function, by = .EACHI, and nomatch = 0. #1933

ProfFancyPants opened this issue Nov 28, 2016 · 4 comments


Copy link

@ProfFancyPants ProfFancyPants commented Nov 28, 2016

Hi guys,

I found a potential bug that crashes Rstudio all together. Here is the reproducible example.

re_d <-
      rn = c("any_of(fn1)", "any_of(fn2)", "main_folder", "stata_file",
        "text?", "text?", "text?"),
      re = c(NA, NA, NA, NA, "[^/]+?", "[^/]+?", "[^/]+?")
    .Names = c("rn", "re"),
    class = c("data.table", "data.frame"),
    row.names = c(NA, -7L),
    sorted = "rn"
pf <- function(x) {
obj_n <- c("excel_file", "fn1", "fn2", "main_folder", "scan_path", "spss_file",  "stata_file", "x")

# This works fine
re_d[, pf(rn)]
# This works fine
re_d[J(obj_n), rn,  by = .EACHI, nomatch = 0]
# This bring the pain train. 
re_d[J(obj_n), pf(rn),  by = .EACHI, nomatch = 0]

Before Rstudio disintegrates all I see is:


My session info:

R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] data.table_1.9.8
loaded via a namespace (and not attached):
[1] tools_3.3.2

Copy link

@mattdowle mattdowle commented Nov 28, 2016

Thank you! Looking ...

@mattdowle mattdowle added this to the v1.9.10 milestone Nov 28, 2016
@mattdowle mattdowle added this to the v1.9.10 milestone Nov 28, 2016
@mattdowle mattdowle removed this from the v1.9.12 milestone Nov 28, 2016
Copy link

@mattdowle mattdowle commented Nov 29, 2016

Interestingly, this crashes with old v1.9.6 as well.

Copy link

@ProfFancyPants ProfFancyPants commented Nov 29, 2016

Exactly. After I posted, I tested it on v1.9.6 and on a mid-ish v1.9.7 build from last year -- all crash. I am glad I was able to isolate this issue. I think I have seen it before a while a few years ago. Can I just say that you and Arun are my heroes, and about 95% of the reason I am even in this field. If I didn't have data.table, I wouldn't have gotten into R. So if you guys need any help at all just tell me. O, and my example might sound like a strange use case, but it is actually quite practical. It is only one line of code, but it is extremely powerful.

Copy link

@mattdowle mattdowle commented Nov 30, 2016

Thanks for the encouragement! And the great example. Found and fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants