getSubjectItems: getSubjectItems

Description Usage Arguments Value Examples

Description

Extracts all subject level data as a data.frame from a FAIRsimulator individual object

Usage

1
2
3
4
5
6
getSubjectItems(subjectObj, scalarItems = c("StudyID", "AgeAtRand",
  "DateAtRand", "RandStudyTime", "RandCohortTime", "CurrentAge",
  "CurrentCohortTime", "TreatmentIndex", "Treatment", "TreatmentEff", "RandNum",
  "DropoutStudyTime", "DropoutCohortTime"), covariates = "Covariates",
  longitudinalItems = c("SampleAge", "CohortSampleTime", "StudySampleTime",
  "Data"), prevTreatment = FALSE)

Arguments

subjectObj

A FAIRsimulator individual object

scalarItems

The scalar items to extract from the individual object. Set to NULL if no scalar items are to be extracted.

covariates

Name of the item that holds the subject specific vector of covariates. Set to NULL if covariates should not be extracted.

longitudinalItems

Name of the longitudinal items to be extracted. Set to NULL if no no longitudina items are to be extracted.

Value

A data frame with nrows=length of the longitudinal items. The scalar and covariate items are replicated to match the longitudinal items.

Examples

1
2
3
4
## Not run: 
getSubjectItems(StudyObj[["CohortList"]][[1]][["SubjectList"]][[1]])
#' 
## End(Not run)

eniclas/FAIRsimulator documentation built on May 16, 2019, 5:12 a.m.