derivation.add: Add a derivation

Description Usage Arguments Details Author(s) Examples

View source: R/clinical.R

Description

Provides a consistent interface for adding a derivation.

Usage

1
derivation.add(derivations, targets, types, deps, data, fun, aept.list, verbose = TRUE)

Arguments

derivations

A data frame of derivation rules

targets

Names of derived variables, whitespace delimited

types

Types of derived variables, in sense of storage.mode(target), whitespace delimited

deps

Names of dependency data frames, whitespace delimited

data

Parseable text of code to extract data

fun

Parseable text of code to derive variables

aept.list

Not used, for guessing derivation rules

verbose

Whether to print progress messages

Details

Read the code or see the examples.

Author(s)

Toby Johnson Toby.x.Johnson@gsk.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
clindata <- derivation.add("path/to/clinical/export/")
data(derivations.standard)
derivations.custom <-
  derivation.add(derivations.standard,
                 targets = 'vsanal.SBP.mean4wk',
                 types = 'double',
                 deps = 'vitals',
                 data = 'subset(vsanal, VSTEST == "Systolic BP~(mmHg)" &
                                        ATTYPE == "On-therapy" &
                                        VSACTDY >= 1 & VSACTDY <= 35)',
                 fun = 'safe(mean, VSSTRESN)')
gxvars <- clinical.derive(clindata, derivations.custom)
summary(gxvars)

## End(Not run)

tobyjohnson/gtx documentation built on Aug. 30, 2019, 8:07 p.m.