simplify_weatherdata: Simplify weather data for multi-station cities

Description Usage Arguments Value Examples

View source: R/simplify_weatherdata.R

Description

For multi-station cities, aggregates numeric values of weather data, calculates their mean value for each day and simplifies the columns to an easy-to-use daily data format.

Usage

1
simplify_weatherdata(weatherdata)

Arguments

weatherdata

Data frame containing the result of get_weatherdata function

Value

Modified data frame containing one row for each day; 2 columns containing date and mean weather data value for that date.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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")

# Get weatherdata for Berlin (only September)
weatherdata = get_weatherdata("TAVG", "GM000001", "2018-09-01", "2018-09-23")

# Since there are 2 stations with weather data for Berlin, we modify the data
weatherdata_simplified = simplify_weatherdata(weatherdata)

## End(Not run)

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