cohort {CALIBERdatamanage} | R Documentation |
A class for ‘cohort’ datasets for use in epidemiological studies.
cohort(x, idcolname = c("patid", "anonpatid", "id"), description = NULL)
x |
a data.frame, ffdf or data.table which contains data on patients, one row per patient |
idcolname |
the column name representing the unique patient identifier |
description |
a data.frame with two columns containing column descriptions. The column names must be 'colname' and 'description'. |
Cohort objects have a number of associated methods which make it easier to manage data and generate datasets for analysis. Note that data.table objects are not copied by this function; the original object is modified. If you want to leave the original object as it is, use the copy
function, e.g. mycohort <- cohort(copy(mydataset))
.
An object with classes ‘cohort’ and either ‘data.table’ or ‘ffdf’, and the following attributes:
ID column name
description of the columns
If it is a data.table cohort, the ID column is the leftmost column and all the others are arranged alphabetically.
Anoop Shah
print.cohort
, summary.cohort
, merge.cohort
DT <- cohort(data.table(anonpatid = 1:3, indexdate = as.IDate(c("2012-1-3", "2012-1-2", "2010-1-9")))) print(DT) summary(DT) FFDF <- as.ffdf(data.table(anonpatid = 1:3, indexdate = as.IDate(c("2012-1-3", "2012-1-2", "2010-1-9")))) FFDF <- cohort(FFDF) print(FFDF) summary(FFDF)