ropensci / rnoaa

R interface to many NOAA data APIs
https://docs.ropensci.org/rnoaa
Other
328 stars 84 forks source link

Added hoardr mkdir() call to make sure cache path exists for ghcnd_stations() call #350

Closed mpettis closed 4 years ago

mpettis commented 4 years ago

Fix ghcnd_stations() error.

Description

This fixes the problem where a new ghcnd_stations() call cannot write a local dump of the stations data in the hoardr cache. I added a single line before the GET call to write the data locally to create the cache directory if it doesn't exist, according to what I read about hoardr. The call now works.

I am unsure if this is the appropriate place to place the mkdir() cache creation call, but it is a place that will work for the limited scope call of ghcnd_stations().

Related Issue

Fix #349

sckott commented 4 years ago

thanks, LGTM

looks like we need to add that line to get_inventory as well - i'll do that after merging