determine_NA_NC: Determine which calculated values will are valid

View source: R/utilities.R

determine_NA_NCR Documentation

Determine which calculated values will are valid

Description

Classifies values as NA, NaN, or 999 depending on whether or not the measured values required for that calculation exist for none, some, or all of the parameters.

Usage

determine_NA_NC(df, col1, col2, include_between = F, col_name)

Arguments

df

dataframe containing measured values required for a specific calculation

col1

first parameter required for the calculation

col2

last parameter required for the calculation

include_between

boolean value, defaults to TRUE Do there exist columns between col1 and col2 that must be examined for the existence of valid numbers? If FALSE, no columns other than col1 and col2 must be examined.

col_name

string used to assign a name to the column that stores the result of determine_NA_NC(). If not specified, column is given the name result

Value

A dataframe identical to the input dataframe with one additional column containing the result of determine_NA_NC() and named using col_name. Values are assigned as follows:

  • When all of the parameters required for the calculation are missing values, assign NA

  • When one or more (but not all) of the parameters required for the calculation are missing values, assign NaN

  • When all of the parameters required for the calculation are present values, assign 999 as a placeholder to indicate that a value should be calculated


biogeochem/bpwtpR documentation built on May 6, 2024, 5:17 p.m.