Subset rows in ir
objects using column values
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 toTRUE
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.
See also
Other tidyverse:
arrange.ir()
,
distinct.ir()
,
extract.ir()
,
filter-joins
,
group_by
,
mutate-joins
,
mutate
,
nest
,
pivot_longer.ir()
,
pivot_wider.ir()
,
rename
,
rowwise.ir()
,
select.ir()
,
separate.ir()
,
separate_rows.ir()
,
slice
,
summarize
,
unite.ir()
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>