new_cnd_df: Create a data frame with filtering tags

View source: R/cnd_df.R

new_cnd_dfR 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 dat.

.warn

Whether to warn about creating a new conditioned data frame in case that dat already is one.

Value

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.

See Also

is_cnd_df(), get_cnd_df_cnd(), get_cnd_df_cnd_sum(), rm_cnd_df().


sdtm.oak documentation built on April 3, 2025, 9:37 p.m.