addWeather: Add weather to a "term" object

View source: R/rterm.R

addWeatherR Documentation

Add weather to a "term" object

Description

Adds a weather & instructions to a term object, returns the updated object. If you specified an address in the term construction with newTerm then this function will take care of everything automatically. Note that you can add multiple weather stations to the "term" object with repeated calls of this function.

Usage

addWeather(term, weather = NULL, formula = NULL, stationid = NULL,
  timeVar = NULL, tempVar = NULL, name = NULL)

Arguments

term

the term object to add data

weather

optional dataset if providing your own weather (rather than using the built-in integration with NOAA).

formula

optional specification of time variable and temp variable if providing your own weather. Example temp ~ date.

stationid

optional GHCN ID as found from stationSearch.

timeVar

optional manual specification of date variable if providing your own weather data.

tempVar

optional manual specification of temp variable if providing your own weather data.

name

optional name for this particular weather. Example name = "Sea-Tac" is way better than "SEATTLE-TACOMA INTERNATIONAL AIRPORT"

Value

the term object w/ weather added

See Also

newTerm addData addMethod

Examples

# Add weather
stationSearch("Seattle, WA")
mod <- addWeather(mod, stationid = "GHCND:USW00024234")

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