get_cities: Get information about available cities

Description Usage Value References Examples

View source: R/get_cities.R

Description

get_cities is a function that lists all the available cities for which the data can be fetched with get_weatherdata along with their data availability details.

Usage

1

Value

Data frame containing information about all the cities for which weather data is available and the time period of the data. The following columns are returned:

References

API Reference: https://www.ncdc.noaa.gov/cdo-web/webservices/v2#locations

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 

# First get your API-token here: https://www.ncdc.noaa.gov/cdo-web/token
# Then, set it as system variable (as character variable):
Sys.setenv("NOAA_TOKEN" = "YOUR_TOKEN_GOES_IN_HERE")

cities = get_cities()
head(cities)

head(cities[which(cities$country == "SW"), ]) # Cities in Sweden
head(cities[which(cities$country == "GM"), ]) # Cities in Germany

## End(Not run)

harihp12/cdoapi documentation built on May 28, 2019, 7:29 a.m.