View source: R/weatherHelper.R
plot.stationComp | R Documentation |
Plot a comparison of weather stations returned by
stationCompare
## S3 method for class 'stationComp' plot(sc, days = 14, var = "aveTemp", type = "actual", xvar = "date")
sc |
stationComp object as returned by |
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 |
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. |
a ggplot object of the graphic
stationSearch
stationComp
plot.stationComp
read.ghcn
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.