Skip to contents

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 to TRUE are kept.

.by

[Experimental]

<tidy-select> Optionally, a selection of columns to group by for just this operation, functioning as an alternative to group_by(). For details and examples, see ?dplyr_by.

.preserve

Relevant when the .data input is grouped. If .preserve = FALSE (the default), the grouping structure is recalculated based on the resulting data, otherwise the grouping is kept as is.

Value

A subset of the original data.

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 
#>