stationTrend: Look at a time trend within a station, for example the past 5...

View source: R/weatherHelper.R

stationTrendR Documentation

Look at a time trend within a station, for example the past 5 years

Description

Plot a comparison of weather stations returned by stationCompare

Usage

stationTrend(weather, var = "aveTemp", days = 60, type = "actual")

Arguments

weather

a weather dataset returned by read.ghcn

var

The variable to plot. Optional, defaults to "aveTemp". Can also be "tmin" or "tmax". See read.ghcn

days

The number of days for the rolling average. Optional, defaults to 14.

type

The type of view, can be "actual" or "relative". "actual" will plot the recorded temperatures, while "relative" will plot the temperatures with reference to the mean temperature. "relative" tends to be more useful in visualizing the differences between stations. This argument is optional and defaults to "relative".

Value

a list containing "data" the dataset w/ additional smoothed variable(s) and "plot", the ggplot object

See Also

stationSearch stationComp plot.stationComp read.ghcn

Examples

# Look at the last 5 years from Ted Stevens Intl Airport in Alaska
anc <- read.ghcn("GHCND:USW00026451", "2010-01-01", "2015-04-15")
ancTrend <- stationTrend(anc)
ancTrend$plot

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