For most things, a single value will be returned from each cast, but in the case of "time_to_event" data, the value is expended to a two column data.frame with a tte_<covariate> column for time to event, and an event_<covariate> column to indicate event (1) or right censored (2).

cast_covariate(covariate, values, cov.def, .fds)

Arguments

covariate

the name of the covariate

values

the covariate values (which is a character) as it is pulled from the database.

cov.def

the un-yamled covariate definitions, if missing we rely on pulling this out from the FacileDataSet object .fds

.fds

If missing(cov.def), this is the FacileDataSet to get the covariate definitions from.

Value

values cast to appropriate type if a valid definition was found for covariate, otherwise values is returned "as is". Most of the time this is a single vector, but others it can be a data.frame (for right_censored data, for instance)

Details

The mechanics of how values in the sample_covariate table are converted into R objects are handled by the information stored in the FacileDataSets's meta.yaml file.

See also