Skip to content

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

@ProfFancyPants

Description

@ProfFancyPants

Hi guys,

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

library(data.table)
re_d <-
  structure(
    list(
      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) {
  print(x)
  utils::flush.console()
  return(invisible(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:

[1]
 
 

My session info:

sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions