epiforecasts / covidregionaldata

An interface to subnational and national level COVID-19 data. For all countries supported, this includes a daily time-series of cases. Wherever available we also provide data on deaths, hospitalisations, and tests. National level data is also supported using a range of data sources as well as linelist data and links to intervention data sets.
https://epiforecasts.io/covidregionaldata/
Other
37 stars 18 forks source link

Reduce the number of `Imports` #437

Closed Bisaloo closed 2 years ago

Bisaloo commented 2 years ago

To keep it under the 20 packages limit enforced by CRAN (fix #434).

I would like to remove tidyselect as well but I'm a little bit perplexed about the strange case of where(). It doesn't seem to be explicitly re-exported from dplyr but:

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

starwars %>% 
  summarise(across(where(is.character), ~ length(unique(.x))))
#> # A tibble: 1 × 8
#>    name hair_color skin_color eye_color   sex gender homeworld species
#>   <int>      <int>      <int>     <int> <int>  <int>     <int>   <int>
#> 1    87         13         31        15     5      3        49      38

Created on 2021-11-30 by the reprex package (v2.0.1.9000)

It's probably some tidyeval magick but it also means that we will probably get a warning about where being a global variable if we try it in the package. Maybe the best course of action is to ask dplyr devs if they could explicitly re-export where(), as they do for all the other tidyselect functions(??)

github-actions[bot] commented 2 years ago

👋 Thanks for opening this pull request! Can you please run through the following checklist before requesting review (ticking as complete or if not relevant).

Thank you again for the contribution. If making large scale changes consider using our pre-commit hooks (see the contributing guide) to more easily comply with our guidelines.