The MazamaSpatialUtils package used to determine the ISO state and country code,
and the Olson timezone associated with the locations specified by the
longitude
and latitude
columns of the incoming dataframe.
This function requires previous setup of the MazamaSpatialUtils package with initializeMazamaSpatialUtils()
.
addMazamaMetadata( df, lonVar = "longitude", latVar = "latitude", existingMeta = NULL, countryCodes = c("CA", "US", "MX") )
df | dataframe or tibble with geolocation information (e.g. created by |
---|---|
lonVar | name of longitude variable in the incoming dataframe |
latVar | name of the latitude variable in the incoming dataframe |
existingMeta | existing 'meta' dataframe from which to obtain metadata for known monitor deployments |
countryCodes | vector of countryCodes (use |
Input dataframe with additional columns: timezone, countryCode, stateCode
.
https://github.com/MazamaScience/MazamaSpatialUtils