read_benchmarks: Reading in the benchmarks from the Data Explorer

View source: R/reading.R

read_benchmarksR Documentation

Reading in the benchmarks from the Data Explorer

Description

Reading in the benchmarks from the Data Explorer

Usage

read_benchmarks(
  filename = "",
  filepath = NULL,
  sheet_name = "Monitoring Objectives",
  eval_strings = list(c("Lower.Limit", "LL.Relation", "x"), c("x", "UL.Relation",
    "Upper.Limit"), c("x", "Proportion.Relation", "Required.Proportion"))
)

Arguments

filename

Character string. The filename, including filetype extension, of the .XLSX, .CSV, .XLSM, or .XLS containing the benchmarks. Expects to find columns with headers matching "Management Question", "Benchmark Source", "Benchmark Group", "Reporting Unit", "Lower Limit", "LL Relation", "Indicator", "UL Relation", "Upper Limit", "Unit", "Condition Category", "Proportion Relation", and "Required Proportion".

filepath

Optional character string. The filepath to the location where the file matching filename is stored. Used to locate the file by combining with the filename. Will be ignored if NULL. Defaults to NULL.

sheet_name

Optional character string. The sheet name of the spreadsheet in the Excel workbook specified by filename. Only used if filename is an Excel workbook. Defaults to "Monitoring Objectives".

eval_strings

Optional list of character vectors. If NULL, nothing will be done. Otherwise, each character vector should contain one or more variable/column names from the benchmarks. The only other string allowed is "x" which can be used as a placeholder for indicator values. As an example, list(c("lower.relationship", "lower.limit", "x")) would add a column to the output called "evalstring1" that contains the results of paste(benchmarks$lower.limit, benchmarks$lower.relationship, "x"). Defaults to list(c("Lower.Limit", "LL.Relation", "x"), c("x", "UL.Relation", "Upper.Limit"), c("x", "Required.Relation", "Required.Proportion")), appropriate for use with the AIM "Benchmark Tool".

Value

A data frame of the benchmarks from the specified file with fields containing evaluation strings to use in testing indicator values against the benchmarks.

Examples

read_benchmarks()

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