View source: R/compare_periods_per_plot.R
compare_periods_per_plot | R Documentation |
This function compares for each plot (and other provided variables) the
differences between periods/years for the column names given in parameter
measure_vars
. It gives results for differences between subsequent measures
(based on period
) and between the last and the first measure.
All column names of the dataset that are not added to parameter
measure_vars
,
are considered as grouping variables, except for period
.
If the result is not as expected,
please verify that the dataset only consists of grouping variables,
variables added to measure_vars
and period
.
compare_periods_per_plot(dataset, measure_vars, replace_na_in_vars = NA)
dataset |
dataframe with values for each |
measure_vars |
column names of variables that should be compared between periods (including year) |
replace_na_in_vars |
column names of variables ( |
dataframe with columns plot
, year_diff
, n_years
, grouping
variables and differences between periods for each column of measure_vars
library(forrescalc)
library(dplyr)
treenr_by_plot <-
read_forresdat_table(tablename = "dendro_by_plot") %>%
select(
period, year, plot_id, number_of_tree_species, number_of_trees_ha
) %>%
distinct()
compare_periods_per_plot(
treenr_by_plot, c("year", "number_of_tree_species", "number_of_trees_ha")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.