Skip to content

SET_STRING_ELT error when rbindlist contains both tables with ordered factors of different levels and tables with ordered factors of common levels #3032

@HughParsonage

Description

@HughParsonage

Related issue #899 was closed in 67ace19

# Minimal reproducible example

library(data.table)
# data.table 1.11.5 IN DEVELOPMENT built 2018-09-05 02:11:00 UTC; appveyor  Latest news: r-datatable.com

dt1 <- data.table(x = as.ordered(letters[c(1, 3, 5:8)]))
dt2 <- data.table(x = as.ordered(letters[c(2, 5:8)]))
dt3 <- data.table(x = as.ordered(letters[c(2, 5:8)]))

rbindlist(list(dt1, dt2, dt3), use.names = TRUE, fill = TRUE)
#> Error in rbindlist(list(dt1, dt2, dt3), use.names = TRUE, fill = TRUE):
#>   attempt to set index 7/7 in SET_STRING_ELT

Created on 2018-09-06 by the reprex package (v0.2.0).

# Output of sessionInfo()

R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252   
[3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
[5] LC_TIME=English_Australia.1252    

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

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

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.18     ps_1.1.0         rprojroot_1.3-2  digest_0.6.16   
 [5] crayon_1.3.4     withr_2.1.2      assertthat_0.2.0 R6_2.2.2        
 [9] backports_1.1.2  magrittr_1.5     reprex_0.2.0     evaluate_0.11   
[13] stringi_1.1.7    rlang_0.2.2      rstudioapi_0.7   callr_3.0.0     
[17] whisker_0.3-2    rmarkdown_1.10   devtools_1.13.6  tools_3.5.1     
[21] stringr_1.3.1    yaml_2.2.0       compiler_3.5.1   processx_3.2.0  
[25] base64enc_0.1-3  clipr_0.4.1      htmltools_0.3.6  memoise_1.1.0   
[29] knitr_1.20 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions