Skip to content

where and allow_rename = FALSE produce an error in eval_select() #225

Closed
@mgirlich

Description

@mgirlich

I get the error Can't rename variables in this context. even though I am not renaming but only selecting with the help of where(is.numeric). I guess that both should work

library(tidyselect)

eval_select(
  quo(where(is.numeric)),
  mtcars,
  allow_rename = TRUE
)
#>  mpg  cyl disp   hp drat   wt qsec   vs   am gear carb 
#>    1    2    3    4    5    6    7    8    9   10   11

eval_select(
  quo(where(is.numeric)),
  mtcars,
  allow_rename = FALSE
)
#> Error: Can't rename variables in this context.

Created on 2021-01-27 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.0.3 (2020-10-10)
#>  os       macOS Big Sur 10.16         
#>  system   x86_64, darwin17.0          
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       UTC                         
#>  date     2021-01-27                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version    date       lib source                      
#>  assertthat    0.2.1      2019-03-21 [1] CRAN (R 4.0.2)              
#>  callr         3.5.1      2020-10-13 [1] CRAN (R 4.0.2)              
#>  cli           2.2.0      2020-11-20 [1] CRAN (R 4.0.2)              
#>  crayon        1.3.4      2017-09-16 [1] CRAN (R 4.0.2)              
#>  desc          1.2.0      2018-05-01 [1] CRAN (R 4.0.2)              
#>  devtools      2.3.2      2020-09-18 [1] CRAN (R 4.0.2)              
#>  digest        0.6.27     2020-10-24 [1] CRAN (R 4.0.2)              
#>  ellipsis      0.3.1      2020-05-15 [1] CRAN (R 4.0.2)              
#>  evaluate      0.14       2019-05-28 [1] CRAN (R 4.0.1)              
#>  fansi         0.4.2      2021-01-15 [1] CRAN (R 4.0.2)              
#>  fs            1.5.0      2020-07-31 [1] CRAN (R 4.0.2)              
#>  glue          1.4.2      2020-08-27 [1] CRAN (R 4.0.2)              
#>  highr         0.8        2019-03-20 [1] CRAN (R 4.0.2)              
#>  htmltools     0.5.1.1    2021-01-22 [1] CRAN (R 4.0.2)              
#>  knitr         1.30       2020-09-22 [1] CRAN (R 4.0.2)              
#>  lifecycle     0.2.0      2020-03-06 [1] CRAN (R 4.0.2)              
#>  magrittr      2.0.1      2020-11-17 [1] CRAN (R 4.0.2)              
#>  memoise       1.1.0      2017-04-21 [1] CRAN (R 4.0.2)              
#>  pkgbuild      1.2.0      2020-12-15 [1] CRAN (R 4.0.3)              
#>  pkgload       1.1.0      2020-05-29 [1] CRAN (R 4.0.2)              
#>  prettyunits   1.1.1      2020-01-24 [1] CRAN (R 4.0.2)              
#>  processx      3.4.5      2020-11-30 [1] CRAN (R 4.0.2)              
#>  ps            1.5.0      2020-12-05 [1] CRAN (R 4.0.2)              
#>  purrr         0.3.4      2020-04-17 [1] CRAN (R 4.0.2)              
#>  R6            2.5.0      2020-10-28 [1] CRAN (R 4.0.2)              
#>  remotes       2.2.0      2020-07-21 [1] CRAN (R 4.0.2)              
#>  rlang         0.4.10     2020-12-30 [1] CRAN (R 4.0.2)              
#>  rmarkdown     2.6        2020-12-14 [1] CRAN (R 4.0.3)              
#>  rprojroot     2.0.2      2020-11-15 [1] CRAN (R 4.0.2)              
#>  sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 4.0.2)              
#>  stringi       1.5.3      2020-09-09 [1] CRAN (R 4.0.2)              
#>  stringr       1.4.0      2019-02-10 [1] CRAN (R 4.0.2)              
#>  testthat      3.0.1      2020-12-17 [1] CRAN (R 4.0.3)              
#>  tidyselect  * 1.1.0      2020-05-11 [1] CRAN (R 4.0.2)              
#>  usethis       2.0.0      2020-12-10 [1] CRAN (R 4.0.2)              
#>  vctrs         0.3.6.9000 2021-01-20 [1] Github (r-lib/vctrs@41f841e)
#>  withr         2.4.0      2021-01-16 [1] CRAN (R 4.0.2)              
#>  xfun          0.20       2021-01-06 [1] CRAN (R 4.0.3)              
#>  yaml          2.2.1      2020-02-01 [1] CRAN (R 4.0.2)              
#> 
#> [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions