ropensci-archive / bomrang

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

Fix incorrect coercion for `rel_hum` in `get_current_weather` #125

Closed HughParsonage closed 3 years ago

HughParsonage commented 3 years ago

Description

get_currrent_weather used as.integer("rel_hum") to coerce the column rel_hum to integer, but this attempts to coerce the string literal "rel_hum" which is always NA. The original intent was to map strings like `"-"`` to NA but leave the others as integer. However, this is not guaranteed for other columns so the simplest fix is just to remove the offending line.

Example

# before 
head(get_current_weather("ALICE SPRINGS")$rel_hum)
#> NA NA NA NA NA NA

# now
#> 40 37 34 43 40 39   

I haven't included tests because sometimes the data really will be a column full of NA.

adamhsparks commented 3 years ago

Thanks, Hugh. I merged everything locally and did some more work for a new release that I just submitted tonight. Will just close this.