View source: R/plot_climate_phase.R
| dm_plot_climate_compare | R Documentation |
Plots and compares multiple climate variables attached to climate-augmented
dendrometer outputs. It works with objects of class daily_output_clim,
ZG_output_clim, and SC_output_clim.
Supported plot types include faceted time-series, grouped boxplots, violin plots, combined violin-boxplots, correlation heatmaps, and regression heatmaps.
dm_plot_climate_compare(
x,
climate_vars = NULL,
numeric_vars = NULL,
scale = c("auto", "daily", "cycle", "point"),
type = c("timeseries", "boxplot", "violin", "both", "cor_heatmap",
"regression_heatmap"),
group_var = NULL,
Year = NULL,
DOY = NULL,
box_scales = c("free_y", "fixed"),
cor_method = c("pearson", "spearman", "kendall"),
use_pairwise = TRUE,
regression_stat = c("r.squared", "slope", "p.value"),
point_alpha = 0.5,
show_values = FALSE,
temporal = NULL
)
x |
A climate-augmented dendrometer object. |
climate_vars |
Character vector of climate variables to compare. If
|
numeric_vars |
Optional character vector of numeric variables 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. |
box_scales |
Character. Facet scale behavior for grouped plots. One of
|
cor_method |
Character. Correlation method. One of |
use_pairwise |
Logical. If |
regression_stat |
Character. Statistic shown in regression heatmaps.
One of |
point_alpha |
Numeric. Alpha value for points. |
show_values |
Logical. If |
temporal |
Deprecated argument kept for compatibility with older examples. It is ignored. |
For type = "regression_heatmap", pairwise simple linear regressions
are fitted as y ~ x for every variable combination. The heatmap can
display R^2, slope, or p-value.
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_compare(
zg_clim,
climate_vars = c("temp_mean_phase", "VPD_mean_phase", "RH_mean_phase"),
scale = "cycle",
type = "boxplot"
)
plot(
zg_clim,
climate_vars = c("temp_mean_phase", "VPD_mean_phase", "RH_mean_phase"),
scale = "cycle",
type = "boxplot"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.