Get location info from a vector of locations via BrAPI
getLatLongElevFromLocationVec.RdQueries the BrAPI /search/locations endpoint and
returns a data frame of lat, long, and elevation values for those locations
Arguments
- loc_vec
A vector of location names or DB IDs for which you want lat, long, and elevation values
- brapiConnection
A BrAPI connection object, typically from
BrAPI::createBrAPIConnection(), with a$search()method.- id_or_name
A string. If "name" will expect loc_vec to be a vector of location names else a vector of location DB IDs.
Examples
if (FALSE) { # \dontrun{
brapiConn <- BrAPI::createBrAPIConnection("wheat.triticeaetoolbox.org", is_breedbase = TRUE)
locs_df <- getLatLongElevFromLocationVec(c("31", "143"), brapiConn)
locs_df
} # }