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

unique.data.table inconsistent with unique.data.frame when handling Inf #3372

Closed
ampu3ro opened this issue Feb 7, 2019 · 2 comments
Closed
Labels
Milestone

Comments

@ampu3ro
Copy link

ampu3ro commented Feb 7, 2019

I'm not sure if this is intentional but doesn't seem like it should be. Looks like forderv is probably the culprit.

library(data.table)

x <- c(0, Inf)
unique(data.frame(x))
#>     x
#> 1   0
#> 2 Inf
unique(data.table(x))
#>    x
#> 1: 0
unique(data.table(c(x, 1)))
#>     V1
#> 1:   0
#> 2: Inf
#> 3:   1

devtools::session_info()
#> - Session info ----------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.5.2 (2018-12-20)
#>  os       Windows 7 x64 SP 1          
#>  system   x86_64, mingw32             
#>  ui       RTerm                       
#>  language (EN)                        
#>  collate  English_United States.1252  
#>  ctype    English_United States.1252  
#>  tz       America/New_York            
#>  date     2019-02-07                  
#> 
#> - Packages --------------------------------------------------------------
#>  package     * version    date       lib
#>  assertthat    0.2.0      2017-04-11 [1]
#>  backports     1.1.3      2018-12-14 [1]
#>  callr         3.1.1      2018-12-21 [1]
#>  cli           1.0.1      2018-09-25 [1]
#>  crayon        1.3.4      2017-09-16 [1]
#>  data.table  * 1.12.1     2019-02-07 [1]
#>  desc          1.2.0      2018-05-01 [1]
#>  devtools      2.0.1      2018-10-26 [1]
#>  digest        0.6.18     2018-10-10 [1]
#>  evaluate      0.12       2018-10-09 [1]
#>  fs            1.2.6      2018-08-23 [1]
#>  glue          1.3.0      2018-07-17 [1]
#>  highr         0.7        2018-06-09 [1]
#>  htmltools     0.3.6      2017-04-28 [1]
#>  knitr         1.21       2018-12-10 [1]
#>  magrittr      1.5        2014-11-22 [1]
#>  memoise       1.1.0      2017-04-21 [1]
#>  pkgbuild      1.0.2.9000 2019-02-07 [1]
#>  pkgload       1.0.2      2018-10-29 [1]
#>  prettyunits   1.0.2      2015-07-13 [1]
#>  processx      3.2.1      2018-12-05 [1]
#>  ps            1.3.0      2018-12-21 [1]
#>  R6            2.3.0      2018-10-04 [1]
#>  Rcpp          1.0.0      2018-11-07 [1]
#>  remotes       2.0.2      2018-10-30 [1]
#>  rlang         0.3.1      2019-01-08 [1]
#>  rmarkdown     1.11       2018-12-08 [1]
#>  rprojroot     1.3-2      2018-01-03 [1]
#>  sessioninfo   1.1.1      2018-11-05 [1]
#>  stringi       1.2.4      2018-07-20 [1]
#>  stringr       1.3.1      2018-05-10 [1]
#>  testthat      2.0.1      2018-10-13 [1]
#>  usethis       1.4.0      2018-08-14 [1]
#>  withr         2.1.2      2018-03-15 [1]
#>  xfun          0.4        2018-10-23 [1]
#>  yaml          2.2.0      2018-07-25 [1]
#>  source                                
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  Github (Rdatatable/data.table@4cf5f45)
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  Github (r-lib/pkgbuild@6e4ebdf)       
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#>  CRAN (R 3.5.2)                        
#> 
#> [1] C:/Program Files/R/R-3.5.2/library
```R
@arunsrinivasan
Copy link
Member

Seems to be due to the change in logic of unique.data.table to implement things directly in this commit: 1fd3862#diff-a17242becd5cd79fa6fc4e916d0d6208

Taking a look now.

@arunsrinivasan
Copy link
Member

This seems to be an issue with the new forderv implementation. See #3381. Have filed it as a HIGH priority. When fixed, this should automatically be taken care of as well.

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

3 participants