A few steps are required to get the elevation data for a given field trial (there might be a more straightforward manner, though):

  1. Get the country name based on the map.where function from the maps package

  2. Convert the country name to ISO code for countries

  3. Use the getData function from raster package using the ISO codes and the longitude and latitude data to obtain elevation

get_elevation(info_environments, path = NULL)

Arguments

info_environments

data.frame object with at least the 4 first columns.

  1. year: numeric Year label of the environment

  2. location: character Name of the location

  3. longitude: numeric longitude of the environment

  4. latitude: numeric latitude of the environment

  5. planting.date: (optional) Date YYYY-MM-DD

  6. harvest.date: (optional) Date YYYY-MM-DD

  7. IDenv: character ID of the environment (location x year)

@return elevation_datadata.frame object with 2 columns.

  1. IDenv

  2. elevation

@export @author Cathy C. Westhues