ropensci / rnoaa

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

isd_stations and isd_stations_search different parameter names for "lat" and "long" #238

Closed kev-ho closed 5 years ago

kev-ho commented 6 years ago

I noticed that the function isd_stations_search renames the parameters for "lat" and "lon" to "latitude" and "longitude".

This is different to isd_stations which keeps parameters as "lat" and "lon".

Is this desired behaviour?

names(isd_stations())

[1] "usaf" "wban" "station_name" "ctry" "state" "icao" "lat" "lon" "elev_m" "begin" "end"

names(isd_stations_search(lat = 40, lon = -125, radius = 150))

[1] "usaf" "wban" "station_name" "ctry" "state" "icao" "latitude" "longitude" "elev_m" "begin" "end" "distance"

sckott commented 6 years ago

i think i changed lat/lon to latitude/longitude because we used meteo_distance internally within isd_stations_search, which uses meteo_process_geographic_data, which expects latitude/longitude column names https://github.com/ropensci/rnoaa/blob/master/R/meteo_distance.R#L225-L226

it probably would be easiest to change back column names after coming back from the meteo_distance call within isd_stations_search

sckott commented 5 years ago

@kevin-ht-ho sorry for long wait on this

changed output of isd_stations_search back to lat/lon instead of latitude/longitude