Filter acts in the same way as in dplyr
where predicates which evaluate to
TRUE act to select items to include, and items for which the predicate cannot
be evaluated are excluded. For tracking prior to the filter operation the
size of each group is calculated {.count.in} and after the operation the
output size of each group {.count.out}. The grouping {.strata} is also
available (if grouped) for reporting. See dplyr::filter()
.
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). See Methods, below, for more details.
<data-masking
> Expressions that
return a logical value, and are defined in terms of the variables in
.data
. If multiple expressions are included, they are combined with the
&
operator. Only rows for which all conditions evaluate to TRUE
are
kept.
a set of glue specs. The glue code can use any global variable, or {.strata},{.count.in},and {.count.out}
a headline glue spec. The glue code can use any global variable, or {.strata},{.count.in},and {.count.out}
the format type of the action typically an exclusion
if the type is exclusion, .asOffshoot
places the
information box outside of the main flow, as an exclusion.
a name for this step in the pathway
if you want the summary data from this step in the future then
give it a name with .tag
.
the filtered .data dataframe with history graph updated
dplyr::filter()
library(dplyr)
library(dtrackr)
tmp = iris %>% track() %>% group_by(Species)
tmp %>% filter(Petal.Length > 5) %>% history()
#> dtrackr history:
#> number of flowchart steps: 2 (approx)
#> tags defined: <none>
#> items excluded so far: <not capturing exclusions>
#> last entry / entries:
#> └ "stratify by Species"