ropensci-archive / bomrang

:warning: ARCHIVED :warning: Australian government Bureau of Meteorology (BOM) data client for R
Other
109 stars 26 forks source link

Add sweep_for_forecast_towns() #101

Closed jimjam-slam closed 5 years ago

jimjam-slam commented 5 years ago

Description

This PR adds a function, sweep_for_forecast_towns(), that functions and is structured almost identically to sweep_for_stations() (the only significant difference being that it refers to the forecast town list, not the station list). I've run devtools::document(), so an accompanying .Rd file is included.

I've also added a test for the new function—I didn't want to be presumptuous about which towns might be in the list, so I modified the station list test to instead test for the presence of expected column names.

I've add this change to NEWS.md, too.

Related Issue

Example

head(sweep_for_forecast_towns(), 5)
#         aac              town      lon       lat  elev  distance
# 1 NSW_PT027          Canberra 149.2003 -35.30880 577.6  0.978894
# 2 NSW_PT235        Queanbeyan 149.2346 -35.34850 612.0  6.239984
# 3 NSW_PT329 Portable RFSACT03 149.3162 -35.31110 719.0 10.616459
# 4 NSW_PT281      Woden Valley 149.0845 -35.34844 610.0 11.778605
# 5 NSW_PT254         Belconnen 149.0677 -35.23538 570.0 13.997058
adamhsparks commented 5 years ago

Sorry, I merged it before commenting. Thank you, @rensa, for the PR. Impeccable timing as I've been running through checks today for a new CRAN submission. This will be included in the next release.

jimjam-slam commented 5 years ago

Aww, fantastic! Thanks very much, Adam 😄