ropensci / weathercan

R package for downloading weather data from Environment and Climate Change Canada
https://docs.ropensci.org/weathercan
GNU General Public License v3.0
102 stars 29 forks source link

Error any_of is not an exported object from "namespace:dplyr" #111

Closed mjdzr closed 3 years ago

mjdzr commented 3 years ago

Hi all. I wanted to use a simple function of weather_dl but got some errors. I thought I should update my R to 4.0 and also my weathercan to the newest version. However I still get the error:

library(weathercan)
library(xlsx)
library(tidyr)
library(dplyr)

#Using an example of weather_dl:
kam.pg <- weather_dl(station_ids = c(48248, 51423),
                     start = "2016-01-01", end = "2016-02-15")

Error: 'any_of' is not an exported object from 'namespace:dplyr'

steffilazerte commented 3 years ago

Hmm try updating dplyr:install.packages("dplyr") Or all your packages:remotes::update_packages()Let me know how that goes!SteffiOn Mar 21, 2021 5:58 PM, francesc2 @.***> wrote: Hi all. I wanted to use a simple function of weather_dl but got some errors. I thought I should update my R to 4.0 and also my weathercan to the newest version. However I still get the error: library(weathercan) library(xlsx) library(tidyr) library(dplyr)

Using an example of weather_dl:

kam.pg <- weather_dl(station_ids = c(48248, 51423), start = "2016-01-01", end = "2016-02-15")

Error: 'any_of' is not an exported object from 'namespace:dplyr'

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe. On Mar 21, 2021 5:58 PM, francesc2 @.***> wrote: Hi all. I wanted to use a simple function of weather_dl but got some errors. I thought I should update my R to 4.0 and also my weathercan to the newest version. However I still get the error: library(weathercan) library(xlsx) library(tidyr) library(dplyr)

Using an example of weather_dl:

kam.pg <- weather_dl(station_ids = c(48248, 51423), start = "2016-01-01", end = "2016-02-15")

Error: 'any_of' is not an exported object from 'namespace:dplyr'

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe. On Mar 21, 2021 5:58 PM, francesc2 @.***> wrote: Hi all. I wanted to use a simple function of weather_dl but got some errors. I thought I should update my R to 4.0 and also my weathercan to the newest version. However I still get the error: library(weathercan) library(xlsx) library(tidyr) library(dplyr)

Using an example of weather_dl:

kam.pg <- weather_dl(station_ids = c(48248, 51423), start = "2016-01-01", end = "2016-02-15")

Error: 'any_of' is not an exported object from 'namespace:dplyr'

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.

CamMakoJ commented 3 years ago

Hrmm im having the same error as mentioned prior - I have updated all my packages here is the trace on the error:

Error: 'any_of' is not an exported object from 'namespace:dplyr' Run rlang::last_error() to see where the error occurred.

rlang::last_error() <error/rlang_error> 'any_of' is not an exported object from 'namespace:dplyr' Backtrace:

  1. weathercan::weather_dl(...)
  2. base::.handleSimpleError(...)
  3. tidyselect:::h(simpleError(msg, call)) Run rlang::last_trace() to see the full context. rlang::last_trace() <error/rlang_error> 'any_of' is not an exported object from 'namespace:dplyr' Backtrace: x
  4. +-weathercan::weather_dl(...)
  5. | -weathercan:::weather_format(...)
  6. | +-dplyr::select(...)
  7. | -dplyr:::select.data.frame(...)
  8. | -tidyselect::vars_select(tbl_vars(.data), !!!enquos(...))
  9. | -tidyselect:::eval_select_impl(...)
  10. | +-tidyselect:::with_subscript_errors(...)
  11. | | +-base::tryCatch(...)
  12. | | | -base:::tryCatchList(expr, classes, parentenv, handlers)
  13. | | | -base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
  14. | | | -base:::doTryCatch(return(expr), name, parentenv, handler)
  15. | | -tidyselect:::instrument_base_errors(expr)
  16. | | -base::withCallingHandlers(...)
  17. | -tidyselect:::vars_select_eval(...)
  18. | -tidyselect:::walk_data_tree(expr, data_mask, context_mask)
  19. | -tidyselect:::eval_c(expr, data_mask, context_mask)
  20. | -tidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
  21. | -tidyselect:::walk_data_tree(new, data_mask, context_mask)
  22. | -tidyselect:::eval_context(expr, context_mask)
  23. | -rlang::eval_tidy(expr, context_mask)
  24. +-dplyr::any_of
  25. | -base::getExportedValue(pkg, name)
  26. | -base::stop(...)
  27. -base::.handleSimpleError(...)
  28. -tidyselect:::h(simpleError(msg, call)) <error/simpleError> 'any_of' is not an exported object from 'namespace:dplyr'
boshek commented 3 years ago

@CamMakoJ Can you post the results of sessionInfo()? A strange error as any_of is definitely exported by dplyr.

CamMakoJ commented 3 years ago

Getting station: 2205 Formatting station data: 2205 Error: 'any_of' is not an exported object from 'namespace:dplyr' Run rlang::last_error() to see where the error occurred.

sessionInfo() R version 3.6.1 (2019-07-05) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale: [1] LC_COLLATE=English_Canada.1252 LC_CTYPE=English_Canada.1252
[3] LC_MONETARY=English_Canada.1252 LC_NUMERIC=C
[5] LC_TIME=English_Canada.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] weathercan_0.5.0 dplyr_0.8.3 tidyr_1.0.0

loaded via a namespace (and not attached): [1] Rcpp_1.0.2 rstudioapi_0.13 magrittr_2.0.1 hms_1.0.0 tidyselect_1.1.0 [6] R6_2.5.0 rlang_0.4.10 fastmap_1.1.0 fansi_0.4.0 stringr_1.4.0
[11] httr_1.4.2 tools_3.6.1 utf8_1.1.4 ellipsis_0.3.1 assertthat_0.2.1 [16] tibble_2.1.3 lifecycle_1.0.0 crayon_1.4.1 readr_1.3.1 purrr_0.3.2
[21] vctrs_0.3.6 curl_4.2 memoise_2.0.0 glue_1.3.1 cachem_1.0.4
[26] stringi_1.4.3 compiler_3.6.1 pillar_1.5.1 lubridate_1.7.4 pkgconfig_2.0.3

boshek commented 3 years ago

Ok that helps. @CamMakoJ you haven't actually updated your packages. You have dplyr 0.8.3 but the current version is 1.0.5. Try running update.packages(). That should fix this.

steffilazerte commented 3 years ago

Thanks @boshek, I'll try to make this a priority to update the package requirements for dplyr. Not sure I want to push to cran just for that though 😐

boshek commented 3 years ago

This is a great tool to check dependency version requirements: https://shiny.andyteucher.ca/shinyapps/rver-deps/

steffilazerte commented 3 years ago

@boshek Unfortunately that tool is only for figuring out your minimum version of R, not the minimum version required by your dependencies. But ah well! Still a useful tool!