Description Usage Arguments Value Author(s)
View source: R/time_spline_plot.r
This function produces a 2D field plot of a value, with the x-axis representing year, and the y-axis representing day of year (julian day). A raw plot, and a plot with a 2D spline smooth are produced. These plots are useful for visually examining seasonal trends and cycles in meteorological variables over long time periods.
1 | timespline(data, datevar, plotvar, k = 40, hinge = F, col = div_pal(256))
|
data |
A data frame containing the input data. |
datevar |
The name of the column in the data frame containing the date of the observation. This should contain a Date-type value, as formatted by the |
plotvar |
The name of column in the data frame containing the numeric variable to plot. |
k |
The degree of spline smoothing to be performed. Higher values give more detailed plots, but may overfit. |
hinge |
True/False - should the data be hinged over the middle of the year? If false, the y-axis of the plot represents day of year from 1 to 365. If true, values range from 0 to 1 representing "winterness" and "summerness". |
col |
A palette specification. |
Outputs a plot with two panels, one with raw data, and one with 2D spline-smoothed values.
Grant Williamson
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.