ColumnDef: Constructor for 'ColumnDef' object

Description Usage Arguments Value See Also Examples

View source: R/columnDef.R

Description

Constructor for ColumnDef object

Usage

1
2
ColumnDef(columnName, type = NULL, categories = NULL, unit = "",
  displayName = NULL)

Arguments

columnName

(character) name of column as it appears in the raw data

type

(character) how to interpret values in the column, e.g. "numeric" or "categorical" or "logical"

categories

(NULL or factor) expected levels in a categorical column. If this is entered as vector of character values, they will be coerced into factors

unit

(character) unit of the column

displayName

(character) name to use for column in outputs

Value

An ColumnDef object

See Also

ColumnDef-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#Define columns corresponding to arm
#coercing categories into factors
armDef <- ColumnDef(columnName = "grp",
                   type = "categorical",
                   categories = c("patchOnly", "combination"))

#Define columns corresponding to covariates
covariateDef <- list(
  ColumnDef(columnName = "age",
            type = "numeric",
            unit= "years"),
  
  ColumnDef(columnName = "race",
            type = "categorical",
            categories = factor(c("black", "hispanic", "other", "white"),
                                levels=c("black", "white", "hispanic", "other"))))

scientific-computing-solutions/sibyl documentation built on May 21, 2019, 8:40 a.m.