R/entity-attribute-value.R
simple-eav-decode-functions.RdThis is a simple function to handle converting numeric values in the EAV table to numeric data in R.
This is essentially a pass through-function for categorical/character
values in the EAV table. If the def list contains a levels entry, then
the returned value is converted to a factor, with the levels in the order
as defined in def$levels. If more levels appear in x than exist in
def$levels they are appended to the end of the factor levels in
alphabetical order. If more levels are defined in def$levels than appear
in x, they are by default dropped, set droplevels = FALSE to keep them.
eav_decode_real(x, attrname = character(), def = list(), ...) eav_encode_real(x, ...) eav_encode_logical(x, ...) eav_decode_logical(x, attrname = character(), def = list(), ...) eav_encode_cSurv(x, ...) eav_decode_cSurv(x, attrname = character(), def = list(), ...) eav_decode_categorical( x, attrname = character(), def = list(), droplevels = TRUE, ... ) eav_encode_categorical(x, ...)
| x | the values column from the |
|---|---|
| attrname | the name of "attribute" (covariate) in the EAV table. |
| def | the |
a numeric vector of length(x)