View source: R/plot.daily_output.R
| plot.daily_output | R Documentation |
Unified S3 plotting method for objects returned by daily.data().
Missing grouping labels are removed before grouped boxplots are drawn so
NA does not appear on the x-axis.
## S3 method for class 'daily_output'
plot(
x,
y = NULL,
Year = NULL,
DOY = NULL,
type = c("summary", "amplitude", "minmax_ribbon", "timing", "timing_violin", "lag",
"change", "boxplot", "heatmap"),
stat = c("amplitude", "Max_diff", "mean", "median", "Max", "Min", "lag_h",
"Time_min_h", "Time_max_h"),
by = c("month", "month_of_year", "year"),
box_style = c("boxplot", "violin", "both"),
status_cols = c(growing = "forestgreen", shrinking = "firebrick", stable = "grey60"),
timing_segment_cols = c(`max after min` = "grey65", `max before/equal min` = "black"),
...
)
x |
Object of class |
y |
Unused. |
Year |
Optional numeric year or vector of years for subsetting. |
DOY |
Optional numeric vector of length 2 giving the start and end day-of-year for subsetting. |
type |
Plot type. One of
|
stat |
Statistic used for |
by |
Grouping for |
box_style |
Style for |
status_cols |
Colors for |
timing_segment_cols |
Named vector of two colors for the timing connector:
one for |
... |
Unused. |
Plot types:
"summary": daily Min, mean, median, and Max.
"amplitude": daily amplitude through time.
"minmax_ribbon": ribbon between daily Min and Max.
"timing": per-day line connecting daily minimum and maximum timing.
"timing_violin": violin distribution of Time_min_h
and Time_max_h for the selected window.
"lag": signed lag between daily maximum and minimum time.
"change": day-to-day change in daily maximum
Max_diff.
"boxplot": grouped distributions of a chosen daily statistic.
For by = "month", monthly groups are plotted on a continuous
date axis. The axis limits are extended beyond the first and last
plotted month so edge months are not clipped.
"heatmap": year x day-of-year heatmap of a chosen daily statistic.
For type = "timing", the red and blue points are not connected across
days. Instead, each day has its own segment connecting minimum and maximum
time.
A ggplot2 object, returned invisibly.
data(nepa17)
dd <- daily.data(df = nepa17[1:1000, ], TreeNum = 1)
plot(dd)
plot(dd, type = "timing")
plot(dd, type = "timing", Year = 2017, DOY = c(1, 6))
plot(dd, type = "timing_violin", Year = 2017, DOY = c(1, 6))
plot(dd, type = "boxplot", stat = "amplitude", by = "month")
plot(dd, type = "boxplot", stat = "amplitude", by = "month_of_year",
box_style = "both")
plot(dd, type = "change")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.