stationSearch: Search for GHCN Weather Stations

View source: R/weatherHelper.R

stationSearchR Documentation

Search for GHCN Weather Stations

Description

Search by location name, station name or latitude/longitude for GHCN weather stations that can be loaded with read.ghcn. Note that you need to acquire a Google Maps API key for the default functionality, which is to search for stations close to a latitude/longitude as returned by a Google Maps geocode.

Usage

stationSearch(geocode = NULL, stationName = NULL, lat = NULL,
  lon = NULL, nClosest = 5, country = NULL, state = NULL,
  elevThreshold = NULL)

Arguments

geocode

The default input. A string that will be sent to Google Maps to get a latitude/longitude. This must be loaded into your R session as "google_key"

lat

Latitude

lon

Longitude

nClosest

The number of stations to return when searching on latitude & longitude. Example: nClosest = 10 will show the 10 closest stations. Optional, defaults to 5.

country

an optional specification of country

state

an optional specification of us state

name

A name to search for in the list of station names. Evaluated as a regular expression.

Value

a data frame with information about the relevant stations found. In the case that you specified lat/lon instead of a name this will include station distance in miles from the searched location.

See Also

read.ghcn stationCompare read.noaa

Examples

# Look for a weather station in Bend, Oregon
stationSearch("Bend, OR")

# Find the closest weather stations to a lat/lon pair
# specifying a location in the Columbia Basin
stationSearch(lat = 46.943, lon = -119.240)

# It can help to specify state for a common name
stationSearch("Madison")
stationSearch("Madison", state = "wisconsin")

# Do we have weather sites in Switzerland?
stationSearch(country = "Switzerland")

EcotopeResearch/rterm documentation built on Oct. 17, 2022, 4:02 p.m.