removeVariables: Remove columns from a cohort object

Description Usage Arguments Value Author(s) See Also Examples

View source: R/removeColumns.R

Description

Deletes one or more columns and also deletes their description. If the cohort object is a data.table, it is updated by reference, if a flat file data frame the modified object is returned.

Usage

1
2

Arguments

x

a cohort object

colnames

a character vector of the column names to delete

Value

Returns the modified ffdf or data.table, invisibly.

Author(s)

Anoop Shah

See Also

cohort, subset.cohort, modifyDescription

Examples

1
2
3
4
5
COHORT <- cohort(data.table(anonpatid = 1:3,
    indexdate = as.IDate(c("2012-1-3", "2012-1-2", "2010-1-9")),
    sex = c("M", "F", "M")))
removeColumns(COHORT, c('indexdate', 'sex'))
print(COHORT)

CALIBERdatamanage documentation built on Nov. 23, 2021, 3 p.m.