plot.stationComp: Plot a comparison of GHCN weather stations

View source: R/weatherHelper.R

plot.stationCompR Documentation

Plot a comparison of GHCN weather stations

Description

Plot a comparison of weather stations returned by stationCompare

Usage

## S3 method for class 'stationComp'
plot(sc, days = 14, var = "aveTemp",
  type = "actual", xvar = "date")

Arguments

sc

stationComp object as returned by stationCompare

days

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

var

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

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".

xvar

What variable to plot against. Defaults to "date" but can also be "doy" - day of year. "date" gives a long rolling line, while "doy" gives multiple lines on top of each other per station.

Value

a ggplot object of the graphic

See Also

stationSearch stationComp plot.stationComp read.ghcn

Examples

# Compare 5 closest weather stations to Ecotope's Seattle office
stations <- stationSearch("Seattle")
comp <- stationCompare(stations, "2014-01-01", "2014-12-31")
plot(comp)
plot(comp, "days" = 60)
plot(comp, var = "tmin", type = "actual")

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