Skip to contents

Subset rows in ir objects using column values

Usage

filter.ir(.data, ..., .preserve = FALSE)

Arguments

.data

An object of class ir.

...

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

.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

.data with filtered rows.

Examples

## filter
dplyr::filter(ir_sample_data, sample_type == "office paper")
#> # A tibble: 4 × 7
#>   id_measurement id_sample  sample_type  sample_comment klason_lignin
#> *          <int> <chr>      <chr>        <chr>          <units>      
#> 1             55 OFF 10-506 office paper ""             0.203574     
#> 2             56 OFF 13-144 office paper ""             0.318451     
#> 3             57 OFF 08-80  office paper ""             0.562450     
#> 4             58 OFF 08-852 office paper ""             0.054230     
#> # … with 2 more variables: holocellulose <units>, spectra <named list>