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.
Description
get_currrent_weather
usedas.integer("rel_hum")
to coerce the columnrel_hum
to integer, but this attempts to coerce the string literal"rel_hum"
which is alwaysNA
. 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
I haven't included tests because sometimes the data really will be a column full of NA.