get_diff_from_baseline: Function to get scenario difference from baseline values

Description Usage Arguments Value Examples

View source: R/f_compare_with_baseline.R

Description

This function calculates percentage difference comparing scenario with its baseline. It could be used with raw or averaged data.

Usage

1
2
3
4
5
6
get_diff_from_baseline(
  df,
  baseline_period = NULL,
  type_of_diff = "r",
  type_of_baseline = "f"
)

Arguments

df

Data.frame of imported output.*** SWAT file with extract_watersheds_output function

baseline_period

Vector of two values. First with year of beginning

type_of_diff

String from one letter. 'r' stands for relative difference in percentages #' and 'a' for absolute in absolute values. of baseline period and second with end of it. Those two values should have been used in naming scenario folder. Example (c("2000", "2019"))

type_of_baseline

String from one letter. 'f' stands for fixed period difference and "c" for changing. It means "f" would calculate all the difference with one period (example 2000-2019) baseline and "c" with each period baselines (example 2000-2019, 2040-2059, 2080-2099)

Value

Data.frame with all numeric columns recalculated as percentage from baseline.

Examples

1
##get_diff_from_baseline(df, NULL, "r", "c")

biopsichas/swattools documentation built on May 27, 2021, 6:17 p.m.