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")
)

Arguments

df

dataframe or tibble with geolocation information (e.g. created by wrcc_qualityControl() or airsis_qualityControl)

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 NULL for global searches)

Value

Input dataframe with additional columns: timezone, countryCode, stateCode.

References

https://github.com/MazamaScience/MazamaSpatialUtils

See also