apply_benchmarks: Apply benchmarks to data

View source: R/benchmarking.R View source: R/benchmarking.R

apply_benchmarksR Documentation

Apply benchmarks to data

Description

Using data that has unique identifier and indicator value variables, apply benchmarks. The benchmarks are applied to the data based on the benchmark group(s) that the data belong to, which may already be assigned in the data or may be added with a benchmark group lookup table.

Using data that has unique identifier and indicator value variables, apply benchmarks. The benchmarks are applied to the data based on the benchmark group(s) that the data belong to, which may already be assigned in the data or may be added with a benchmark group lookup table.

Usage

apply_benchmarks(
  data,
  idvars,
  benchmark_group_var = NULL,
  benchmark_group_lut = NULL,
  benchmarks,
  verbose = FALSE,
  tdat_version = "2"
)

apply_benchmarks(
  data,
  idvars,
  benchmark_group_var = NULL,
  benchmark_group_lut = NULL,
  benchmarks,
  verbose = FALSE,
  tdat_version = "2"
)

Arguments

data

Data frame or spatial * data frame. The data to be benchmarked. Must contain the variable(s) in idvars as unique identifiers. May be "wide" or "long" data. If wide, then each indicator name should be a variable name. If long, then the indicator names and values should be in variables named "indicator_var" and "value".

idvars

Character string or vecor of character strings. The names of the variable(s) in data which serve as unique identifiers.

benchmark_group_var

Optional character string. The name of the variable that holds the benchmark group memberships. If NULL then it defaults to the variable in benchmark_group_lut that is not in idvars. Defaults to NULL.

benchmark_group_lut

Optional data frame. The lookup table used to assign benchmark group membership to data. Must contain all of the variables in idvar and one additional variable with the benchmark group memberships.

benchmarks

Data frame. The benchmarks in the format produced by read.benchmarks(). If the benchmark group membership variable in other data frames is not "Benchmark.Group" then it must be renamed here.

verbose

Logical. If TRUE then the function will generate additional messages as it executes.

tdat_version

Version of TerrADat used in the analysis for use in indicator lookup(). Defaults to "2".

Value

A long data frame of each point/benchmarked indicator combination with the assigned condition category.

A long data frame of each point/benchmarked indicator combination with the assigned condition category.


nstauffer/aim.analysis documentation built on Nov. 2, 2023, 12:52 a.m.