check_covs_available: Checks whether required covariates for eGFR calculations are...

View source: R/check_covs_available.R

check_covs_availableR Documentation

Checks whether required covariates for eGFR calculations are present

Description

returns true if all patient covs specified in required covs are non-null, non-NA and not a 0-character string. See 'is.nil' for missing data types checked. Returns TRUE if no covariates are required.

Usage

check_covs_available(
  cov_reqs = NULL,
  patient_covs = NULL,
  verbose = TRUE,
  fail = TRUE
)

Arguments

cov_reqs

vector of covariates required for calculating derived covariatiate

patient_covs

named list of covariates

verbose

stop and describe missing covariate(s)?

fail

invoke 'stop()' if not all covariates available?

Examples

check_covs_available(
  egfr_cov_reqs('cockcroft_gault_ideal')[[1]],
  list(creat = 1, weight = 100, height = 160, sex = 'female', age = 90))

clinPK documentation built on May 29, 2024, 3:50 a.m.