8000 as_factor leads to warnings with ellipsis::check_dots_used · Issue #432 · tidyverse/haven · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

as_factor leads to warnings with ellipsis::check_dots_used #432

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

Closed
rubenarslan opened this issue Feb 18, 2019 · 5 comments
Closed

as_factor leads to warnings with ellipsis::check_dots_used #432

rubenarslan opened this issue Feb 18, 2019 · 5 comments

Comments

@rubenarslan
Copy link
Contributor

This used to work without warning, but leads to (I think) a false positive in ellipsis::check_dots_used

Warning: Some components of ... were not used: levels

library(haven)
x <- labelled(rep(1:5, each = 1), c(Bad = 1, Good = 5))
as_factor(x, levels = "both")
@hadley
Copy link
Member
hadley commented Feb 18, 2019

I don't understand this problem. I don't see it:

library(haven)
x <- labelled(rep(1:5, each = 1), c(Bad = 1, Good = 5))
as_factor(x, levels = "both")
#> [1] [1] Bad  2        3        4        [5] Good
#> Levels: [1] Bad 2 3 4 [5] Good

Created on 2019-02-18 by the reprex package (v0.2.1.9000)

And haven doesn't use ellipsis: https://github.com/tidyverse/haven/blob/master/DESCRIPTION#L25-L30

@rubenarslan
Copy link
Contributor Author

haven imports the as_factor generic from forcats. forcats uses ellipsis since this commit

Do you have forcats 4.0.0?

library(haven)
    x <- labelled(rep(1:5, each = 1), c(Bad = 1, Good = 5))
    as_factor(x, levels = "both")
#> Warning: Some components of ... were not used: levels
#> [1] [1] Bad  2        3        4        [5] Good
#> Levels: [1] Bad 2 3 4 [5] Good

Created on 2019-02-18 by the reprex package (v0.2.1)

Session info
devtools::session_info()
#> ─ Session info ──────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.5.2 (2018-12-20)
#>  os       macOS Sierra 10.12.6        
#>  system   x86_64, darwin15.6.0        
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       Europe/Berlin               
#>  date     2019-02-18                  
#> 
#> ─ Packages ──────────────────────────────────────────────────────────────
#>  package     * version date       lib source        
#>  assertthat    0.2.0   2017-04-11 [1] CRAN (R 3.5.0)
#>  backports     1.1.3   2018-12-14 [1] CRAN (R 3.5.0)
#>  callr         3.1.1   2018-12-2
8000
1 [1] CRAN (R 3.5.0)
#>  cli           1.0.1   2018-09-25 [1] CRAN (R 3.5.0)
#>  crayon        1.3.4   2017-09-16 [1] CRAN (R 3.5.0)
#>  desc          1.2.0   2018-05-01 [1] CRAN (R 3.5.0)
#>  devtools      2.0.1   2018-10-26 [1] CRAN (R 3.5.1)
#>  digest        0.6.18  2018-10-10 [1] CRAN (R 3.5.0)
#>  ellipsis      0.0.2   2019-01-09 [1] CRAN (R 3.5.2)
#>  evaluate      0.13    2019-02-12 [1] CRAN (R 3.5.2)
#>  forcats       0.4.0   2019-02-17 [1] CRAN (R 3.5.2)
#>  fs            1.2.6   2018-08-23 [1] CRAN (R 3.5.0)
#>  glue          1.3.0   2018-07-17 [1] CRAN (R 3.5.0)
#>  haven       * 2.0.0   2018-11-22 [1] CRAN (R 3.5.0)
#>  highr         0.7     2018-06-09 [1] CRAN (R 3.5.0)
#>  hms           0.4.2   2018-03-10 [1] CRAN (R 3.5.0)
#>  htmltools     0.3.6   2017-04-28 [1] CRAN (R 3.5.0)
#>  knitr         1.21    2018-12-10 [1] CRAN (R 3.5.1)
#>  magrittr      1.5     2014-11-22 [1] CRAN (R 3.5.0)
#>  memoise       1.1.0   2017-04-21 [1] CRAN (R 3.5.0)
#>  pillar        1.3.1   2018-12-15 [1] CRAN (R 3.5.0)
#>  pkgbuild      1.0.2   2018-10-16 [1] CRAN (R 3.5.0)
#>  pkgconfig     2.0.2   2018-08-16 [1] CRAN (R 3.5.0)
#>  pkgload       1.0.2   2018-10-29 [1] CRAN (R 3.5.0)
#>  prettyunits   1.0.2   2015-07-13 [1] CRAN (R 3.5.0)
#>  processx      3.2.1   2018-12-05 [1] CRAN (R 3.5.0)
#>  ps            1.3.0   2018-12-21 [1] CRAN (R 3.5.0)
#>  R6            2.4.0   2019-02-14 [1] CRAN (R 3.5.2)
#>  Rcpp          1.0.0   2018-11-07 [1] CRAN (R 3.5.0)
#>  remotes       2.0.2   2018-10-30 [1] CRAN (R 3.5.0)
#>  rlang         0.3.1   2019-01-08 [1] CRAN (R 3.5.1)
#>  rmarkdown     1.11    2018-12-08 [1] CRAN (R 3.5.0)
#>  rprojroot     1.3-2   2018-01-03 [1] CRAN (R 3.5.0)
#>  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.5.0)
#>  stringi       1.3.1   2019-02-13 [1] CRAN (R 3.5.2)
#>  stringr       1.4.0   2019-02-10 [1] CRAN (R 3.5.2)
#>  testthat      2.0.1   2018-10-13 [1] CRAN (R 3.5.0)
#>  tibble        2.0.1   2019-01-12 [1] CRAN (R 3.5.2)
#>  usethis       1.4.0   2018-08-14 [1] CRAN (R 3.5.0)
#>  withr         2.1.2   2018-03-15 [1] CRAN (R 3.5.0)
#>  xfun          0.4     2018-10-23 [1] CRAN (R 3.5.0)
#>  yaml          2.2.0   2018-07-25 [1] CRAN (R 3.5.0)
#> 
#> [1] /Users/rubenarslan/R_library
#> [2] /Library/Frameworks/R.framework/Versions/3.5/Resources/library

@hadley
Copy link
Member
hadley commented Feb 18, 2019

Ok, problem was I had old version of ellipsis and I know see the problem.

@hadley
Copy link
Member
hadley commented Feb 18, 2019

I've made a minimal reprex and filed at r-lib/ellipsis#8

@lock
Copy link
lock bot commented Aug 17, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0