new_cnd_df | R Documentation |
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.
new_cnd_df(dat, cnd, .warn = TRUE)
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 |
A data frame dat
with the additional class "cnd_df"
and the
following attributes:
cnd
: The logical vector passed as argument cnd
: TRUE
values mark
rows in dat
to be used for transformations; rows marked with FALSE
are
not transformed; and NA
mark rows whose transformations are to be applied
resulting in NA
.
cnd_sum
: An integer vector of three elements providing the sum of TRUE
,
FALSE
and NA
values in cnd
, respectively.
is_cnd_df()
, get_cnd_df_cnd()
, get_cnd_df_cnd_sum()
,
rm_cnd_df()
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.