getMeta: Find a ISD site code and other meta data

Description Usage Arguments Details Value Author(s) Examples

View source: R/getMeta.R

Description

Get information on meteorological sites

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
getMeta(
  site = "heathrow",
  lat = NA,
  lon = NA,
  country = NA,
  state = NA,
  n = 10,
  end.year = "current",
  plot = TRUE,
  returnMap = FALSE
)

Arguments

site

A site name search string e.g. site = "heathrow". The search strings and be partial and can be upper or lower case e.g. site = "HEATHR".

lat

A latitude in decimal degrees to search. Takes the values -90 to 90.

lon

A longitude in decimal degrees to search. Takes values -180 to 180. Negative numbers are west of the Greenwich meridian.

country

The country code. This is a two letter code. For a full listing see ftp://ftp.ncdc.noaa.gov/pub/data/noaa/country-list.txt.

state

The state code. This is a two letter code.

n

The number of nearest sites to search based on latitude and longitude.

end.year

To help filter sites based on how recent the available data are. end.year can be "current", "any" or a numeric year such as 2016, or a range of years e.g. 1990:2016 (which would select any site that had an end date in that range. By default only sites that have some data for the current year are returned.

plot

If TRUE will plot sites on an interactive leaflet map.

returnMap

Should the leaflet map be returned instead of the meta data? Default is FALSE.

Details

This function is primarily used to find a site code that can be used to access data using importNOAA. Sites searches of approximately 30,000 sites can be carried out based on the site name and based on the nearest locations based on user-supplied latitude and logitude.

See also getMetaLive to download the all meta data to allow re-use and direct querying.

Value

A data frame is returned with all available meta data, mostly importantly including a code that can be supplied to importNOAA. If latitude and longitude searches are made an approximate distance, dist in km is also returned.

Author(s)

David Carslaw

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
## search for sites with name beijing
getMeta(site = "beijing")

## End(Not run)

## Not run: 
## search for near a specified lat/lon - near Beijing airport
## returns 'n' nearest by default
getMeta(lat = 40, lon = 116.9)

## End(Not run)

davidcarslaw/worldmet documentation built on April 8, 2021, 5:50 a.m.