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

Fix dplyr deprecation warnings #136

Closed steffilazerte closed 1 year ago

wgieni commented 1 year ago

Is this related to the warnings I get when running the stations()?

Warning message: There were 20 warnings in dplyr::mutate(). The first warning was: ℹ In argument: tz = purrr::map_chr(.data$tz, ~tz_offset(.x)). Caused by warning in strptime(): ! unknown timezone 'NA' ℹ Run dplyr::last_dplyr_warnings() to see the 19 remaining warnings.

dplyr::last_dplyr_warnings() [[1]] <warning/rlang_warning> Warning in dplyr::mutate(): ℹ In argument: tz = purrr::map_chr(.data$tz, ~tz_offset(.x)). Caused by warning in strptime(): ! unknown timezone 'NA'

Backtrace: ▆

  1. ├─weathercan::stations_dl()
  2. │ └─weathercan:::stations_dl_internal(...)
  3. │ └─... %>% ...
  4. ├─dplyr::mutate(...)
  5. └─dplyr:::mutate.data.frame(...)

[[2]] <warning/rlang_warning> Warning in dplyr::mutate(): ℹ In argument: tz = purrr::map_chr(.data$tz, ~tz_offset(.x)). Caused by warning in as.POSIXct.POSIXlt(): ! unknown timezone 'NA'

Backtrace: ▆

  1. ├─weathercan::stations_dl()
  2. │ └─weathercan:::stations_dl_internal(...)
  3. │ └─... %>% ...
  4. ├─dplyr::mutate(...)
  5. └─dplyr:::mutate.data.frame(...)

[[3]] <warning/rlang_warning> Warning in dplyr::mutate(): ℹ In argument: tz = purrr::map_chr(.data$tz, ~tz_offset(.x)). Caused by warning in strptime(): ! unknown timezone 'NA'

Backtrace: ▆

  1. ├─weathercan::stations_dl()
  2. │ └─weathercan:::stations_dl_internal(...)
  3. │ └─... %>% ...
  4. ├─dplyr::mutate(...)
  5. └─dplyr:::mutate.data.frame(...)

[[4]] <warning/rlang_warning> Warning in dplyr::mutate(): ℹ In argument: tz = purrr::map_chr(.data$tz, ~tz_offset(.x)). Caused by warning in as.POSIXct.POSIXlt(): ! unknown timezone 'NA'

Backtrace: ▆

  1. ├─weathercan::stations_dl()
  2. │ └─weathercan:::stations_dl_internal(...)
  3. │ └─... %>% ...
  4. ├─dplyr::mutate(...)
  5. └─dplyr:::mutate.data.frame(...)

[[5]] <warning/rlang_warning> Warning in dplyr::mutate(): ℹ In argument: tz = purrr::map_chr(.data$tz, ~tz_offset(.x)). Caused by warning in strptime(): ! unknown timezone 'NA'

Backtrace: ▆

  1. ├─weathercan::stations_dl()
  2. │ └─weathercan:::stations_dl_internal(...)
  3. │ └─... %>% ...
  4. ├─dplyr::mutate(...)
  5. └─dplyr:::mutate.data.frame(...)

... with 15 more warnings. ℹ Run dplyr::last_dplyr_warnings(n = 10) to show more.

steffilazerte commented 1 year ago

No, it's not... hmm, can you updated all your packages and try again? If you still have the error, could you share the code you're trying to run? Thanks!

wgieni commented 1 year ago

All libraries are up to date.

R version 4.2.3 (2023-03-15 ucrt) -- "Shortstop Beagle" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

library(weathercan) weathercan v0.6.3 The internal stations data has been deprecated in favour of the function stations(). See ?stations for more details. Warning message: package ‘weathercan’ was built under R version 4.3.0

stations_dl()

stations_dl() According to Environment Canada, Modified Date: 2023-01-24 23:30 UTC
Environment Canada Disclaimers: "Station Inventory Disclaimer: Please note that this inventory list is a snapshot of stations on our website as of the modified date, and may be subject to change without notice." "Station ID Disclaimer: Station IDs are an internal index numbering system and may be subject to change without notice." Stations data saved...
Use stations() to access most recent version and stations_meta() to see when this was last updated Warning message: There were 20 warnings in dplyr::mutate(). The first warning was: ℹ In argument: tz = purrr::map_chr(.data$tz, ~tz_offset(.x)). Caused by warning in strptime(): ! unknown timezone 'NA' ℹ Run dplyr::last_dplyr_warnings() to see the 19 remaining warnings.

steffilazerte commented 1 year ago

Thanks I'll take a look and see what's up.

steffilazerte commented 1 year ago

Hi @wgieni this should have been dealt with in the last update, I'll close this issue soon unless you're still getting problems. Thanks!