new_cnd_df {sdtm.oak} | R Documentation |
Create a data frame with filtering tags
Description
new_cnd_df()
creates a conditioned data frame, classed cnd_df
, meaning
that this function extends the data frame passed as argument by storing a
logical vector cnd
(as attribute) that marks rows for posterior conditional
transformation by methods that support conditioned data frames.
Usage
new_cnd_df(dat, cnd, .warn = TRUE)
Arguments
dat |
A data frame. |
cnd |
A logical vector. Length must match the number of rows in |
.warn |
Whether to warn about creating a new conditioned data frame
in case that |
Value
A data frame dat
with the additional class "cnd_df"
and the
following attributes:
-
cnd
: The logical vector passed as argumentcnd
:TRUE
values mark rows indat
to be used for transformations; rows marked withFALSE
are not transformed; andNA
mark rows whose transformations are to be applied resulting inNA
. -
cnd_sum
: An integer vector of three elements providing the sum ofTRUE
,FALSE
andNA
values incnd
, respectively.
See Also
is_cnd_df()
, get_cnd_df_cnd()
, get_cnd_df_cnd_sum()
,
rm_cnd_df()
.