ParamCheck: General Parameter Checking for PredictRiskScores

Description Usage Arguments Details Value Author(s)

View source: R/ParamCheck.R

Description

ParamCheck evaluates input parameters inherited from the parent.frame; to check for names, values, and validity and ensure that a risk calculation can be carried out. The call is stopped completely when required arguments are not stated or when compulsary inputs are invalid. Invalid values may still be calculated an NA returned with an error message indicating one or more problematic variables.

Usage

1
ParamCheck(input, vars, call, is.table, allow.age, allow.na)

Arguments

input

list of all input values inherited from the function call

vars

character vector of required parameters

call

name of the function being called

is.table

logical; whether a dataset is provided in the parent.frame

allow.age

logical. Whether or not age range is extended outside of 30 - 74; default is TRUE. If set to FALSE, then NA is returned as risk estimate.

allow.na

logical. Whether or not missing values for binary variables and smoking status are treated as 0; default is TRUE. If set to FALSE, then NA is returned as risk estimate.

Details

ParamCheck identifies the following errors and invalid inputs:

  1. missing arguments - operations stops

  2. missing input data - operation stops

  3. invalid sex, age, ethnicity, nzdep, smoking inputs

  4. invalid binary inputs

  5. invalid numeric inputs

  6. invalid level inputs

Value

ParamCheck returns warning messages if any invalid values are detected. In cases where input data is invalid, ParamCheck will stop the function's operation and return an error message.

Author(s)

Billy Wu (R Developer)


billy-nz/PredictRiskScores documentation built on April 4, 2020, 6:23 p.m.