reconverse/incidence2

Warning about change in tidyselect

Closed this issue · 2 comments

Please place an "x" in all the boxes that apply

  • I have the most recent version of incidence2 and R
  • I have found a bug
  • I have a reproducible example

Please include a brief description of the problem with a code example:

library(incidence2)

data(ebola_sim_clean, package = "outbreaks")
dat <- ebola_sim_clean$linelist

inci <- incidence(dat,
                  date_index = date_of_onset,
                  interval = 7,
                  groups = hospital)

green_grey <- "#5E7E80"

facet_plot(inci, fill = green_grey)
#> Warning: Using an external vector in selections was deprecated in tidyselect 1.1.0.
#> ℹ Please use `all_of()` or `any_of()` instead.
#>   # Was:
#>   data %>% select(green_grey)
#> 
#>   # Now:
#>   data %>% select(all_of(green_grey))
#> 
#> See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.

Created on 2022-10-26 with reprex v2.0.2.9000

Looking at the full error stack, this is caused by

incidence2/R/plot.R

Lines 212 to 218 in 6d527d1

tmp <- rlang::enquo(fill)
if (rlang::quo_is_null(tmp)) {
fill <- NULL
} else {
idx <- try(tidyselect::eval_select(tmp, x), silent = TRUE)
if (!inherits(idx, "try-error")) fill <- names(x)[idx]
}


Related: #78

cheers - I'll take a look. If it's a quick fix I'll push a patch if not it may have to wait until I have time to work on the re-factor. Plan is to drop NSE completely and (potentially) pull the plotting out (the current plotting code is a bit of a mess and pain to maintain). Hoping I can improve the scale implementations in {grates} enough so that it can potentially be dropped.

tidyselect functionality dropped by 1ef0420