Location.Rd
Create a Location containing all of the provided properties. Latitude, Longitude, and Altitude are optional and if not provided will be queried from the DataScienceToolkit API using the Location name.
Location(
name = NULL,
abbreviation = NULL,
country_code = NULL,
country_name = NULL,
program = NULL,
type = NULL,
latitude = NULL,
longitude = NULL,
altitude = NULL,
noaa_station_id = NULL
)
Unique location name (must not conflict with an existing location name)
Location abbreviation
ISO Alpha-3 country code
Uppercase english short name from the ISO standard
Name of one or more existing Breeding Programs
Location type (Farm, Field, Greenhouse, Screenhouse, Lab, Storage, Other)
(optional) Location latitude (decimal degrees)
(optional) Location longitude (decimal degrees)
(optional) Location elevation (meters)
(optional) NOAA Station ID (ex: GHCND:US1NYTM0042)
Location
The geocodeLocation
function can be used to obtain lat/lon/alt
properties from a more specific location name (such as a street address), the
results of which can be used to create the Location.
The lookupNOAAStationId
function can be used to obtain the NOAA
Station ID of the location (using its lat and lon) if it is unknown.
Use the getCountryCodes
function to get a list of supported country
codes and the getLocationTypes
function to get a list of supported
location types.
Other Location:
Location-class
,
buildLocationTemplate()
,
geocodeLocation()
,
getCountryCodes()
,
getLocationTypes()
,
lookupNOAAStationID()
,
writeLocationTemplate()
# Use the Location name to query lat/lon/alt properties
location <- Location(
"Batavia, NY",
"BAT",
"USA",
"United States of America",
"Cornell",
"Field"
)
# Geocode an address to use as lat/lon/alt properties
geo <- geocodeLocation("2 Caldwell Drive, Ithaca, NY")
noaa_station_id <- lookupNOAAStationId(geo$latitude, geo$longitude)
#> Error in lookupNOAAStationId(geo$latitude, geo$longitude): could not find function "lookupNOAAStationId"
location <- Location(
"Caldwell - Ithaca, NY",
"ITH_CALD",
"USA",
"United States of America",
"Cornell",
"Field",
geo$latitude,
geo$longitude,
geo$altitude,
noaa_station_id
)
#> Error in eval(expr, envir, enclos): object 'noaa_station_id' not found