rOpenGov / fmi

Finnish Meteorological Institute open data API R client
Other
10 stars 7 forks source link

Add a more general function fmi_stations() to replace fmi_weather_stations() #20

Closed ilarischeinin closed 7 years ago

ilarischeinin commented 7 years ago

As discussed in #18, this PR replaces the old fmi_weather_stations() with fmi_stations(), which:

  1. also includes other types of observation stations besides weather stations
  2. primarily downloads a live version from the FMI website (with either rvest or XML package), but can also use a local version in inst/extdata/fmi_stations.csv (if neither package is available, or e.g. breaking change on the website)
  3. caches a downloaded table for the rest of the session
  4. has tests for the download and to check if the local version is up-to-date
  5. uses English instead of Finnish
  6. returns a tibble

fmi_weather_stations() is now a deprecated alias for fmi_stations(groups="Weather stations").

.travis.yml probably needs to be updated, as R CMD CHECK needs all suggested package to be available.

Update: It seems that by default Travis installs the suggested packages as well.

codecov-io commented 7 years ago

Current coverage is 15.62% (diff: 50.64%)

Merging #20 into master will increase coverage by 15.08%

@@            master        #20   diff @@
=========================================
  Files            4          4          
  Lines          185        256    +71   
  Methods          0          0          
  Messages         0          0          
  Branches         0          0          
=========================================
+ Hits             1         40    +39   
- Misses         184        216    +32   
  Partials         0          0          

Powered by Codecov. Last update 8d20e44...d0d8e86