Filter profiles by their id_cols or (where available) by their prof_id.
This is built on dplyr::filter().
Usage
filter(.data, ..., .by = NULL, .preserve = FALSE)
# S3 method for class 'cfp_dat'
filter(.data, ..., .preserve = FALSE)Arguments
- .data
A
cfp_dat()object or its derivatives.- ...
<
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 toTRUEare kept.- .by
-
<
tidy-select> Optionally, a selection of columns to group by for just this operation, functioning as an alternative togroup_by(). For details and examples, see ?dplyr_by. - .preserve
Relevant when the
.datainput is grouped. If.preserve = FALSE(the default), the grouping structure is recalculated based on the resulting data, otherwise the grouping is kept as is.
Examples
base_dat |>
filter(site == "site_a")
#>
#> A cfp_dat object to be used as input in ConFluxPro models.
#> id_cols: site Date gas
#> number of profiles: 12
#> number of groups: 1
#>
base_dat |>
filter(Date > "2022-03-01")
#>
#> A cfp_dat object to be used as input in ConFluxPro models.
#> id_cols: site Date gas
#> number of profiles: 0
#> number of groups: 0
#>