fillMaskedValues: Select quantitation limits, determine detection condition,...

View source: R/fillMaskedValues.R

fillMaskedValuesR Documentation

Select quantitation limits, determine detection condition, and fill masked values as appropriate.

Description

This function selects a single upper and lower quantitation limit for each record in result (if one exists in detquantlim), determines detection condition for each record based on the presence/absence of a result value, upper or lower quant limits, and whether the result value is above or below quant limits or <=0.

Usage

fillMaskedValues(
  results,
  detquantlim,
  translation_wb,
  detLimitTypeTable_sheetname = "detLimitTypeTable",
  unitConvTable_sheetname = "unitConvTable",
  detLimitTypeTable_startRow = 2,
  unitConvTable_startRow = 1,
  unitConvTable_startCol = 1,
  lql_fac = 0.5,
  uql_fac = 1
)

Arguments

results

A WQP results (must include narrow result, merged, wide objects OK) R-object name.

detquantlim

A WQP detection/quantitation limit file R-object. Should be matching complement to WQP results input.

translation_wb

Full path and filename for IR translation workbook (.xlsx).

detLimitTypeTable_sheetname

Name of sheet in workbook holding detection limit type names and ranked prioritizations table. Defaults to "detLimitTypeTable".

unitConvTable_sheetname

Name of sheet in workbook holding unit conversion table. Defaults to "unitConvTable".

detLimitTypeTable_startRow

Row to start reading the detLimitTypeTable excel sheet from (in case headers have been added). Defaults to 2.

unitConvTable_startRow

Row to start reading the unitConvTable excel sheet from (in case headers have been added). Defaults to 1.

unitConvTable_startCol

Column to start reading the unitConvTable excel sheet from (in case headers have been added). Defaults to 1.

lql_fac

Numeric - factor by which to multiply lower quantitation limit type values when filling masked data or other non-detects (e.g. below lql values). Default = 0.5.

uql_fac

Numeric - factor by which to multiply upper quantitation limit type values when filling masked data or other over limit values. Default = 1.

Value

Returns a data frame with new columns of selected limits, filled values, units, and detection condition appended to results input. In IR_DetCond column, "ND"=non-detect, "OD"=over detection, "NRV"=no result value & no ranked detection limit, "DET"=detection.


ut-ir-tools/irTools documentation built on Jan. 19, 2024, 6:55 p.m.