View source: R/plot_climate_phase.R
| dm_plot_climate | R Documentation |
General plotting function for dendrometer outputs with attached climate
information. It works with objects of class daily_output_clim,
ZG_output_clim, and SC_output_clim, usually produced by
dm_add_climate(), dm_join_daily_clim(),
dm_join_phase_clim(), or dm_join_subdaily_clim().
The function can display one selected climate variable through time, by phase or day status, as boxplots or violin plots, or as a climate-response relationship.
dm_plot_climate(
x,
climate_var,
metric_var = NULL,
scale = c("auto", "daily", "cycle", "point"),
type = c("timeseries", "boxplot", "violin", "both", "relation"),
group_var = NULL,
Year = NULL,
DOY = NULL,
point_alpha = 0.6,
add_smooth = FALSE,
temporal = NULL
)
x |
A climate-augmented dendrometer object. |
climate_var |
Character. Name of the climate variable to plot. |
metric_var |
Optional character. Biological response variable used when
|
scale |
Character. Data level to use. One of |
type |
Character. Plot type. One of |
group_var |
Optional character. Grouping variable. If |
Year |
Optional numeric year or vector of years for subsetting. |
DOY |
Optional numeric vector of length 2 giving the day-of-year range. |
point_alpha |
Numeric. Alpha value for points. |
add_smooth |
Logical. If |
temporal |
Deprecated argument kept for compatibility with older examples. It is ignored. |
A ggplot2 object, returned invisibly.
data(gf_nepa17)
data(ktm_clim_hourly)
zg <- phase.zg(df = gf_nepa17[1:800, ], TreeNum = 1)
zg_clim <- dm_add_climate(
zg,
ktm_clim_hourly,
scale = "phase",
mean_vars = c("temp", "VPD", "RH"),
max_vars = c("temp", "VPD"),
sum_vars = c("prec")
)
dm_plot_climate(
zg_clim,
climate_var = "VPD_mean_phase",
scale = "cycle",
type = "boxplot"
)
plot(
zg_clim,
climate_var = "VPD_mean_phase",
scale = "cycle",
type = "boxplot"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.