Remove columns from a cohort object

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

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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.