Subset columns in ir objects using column names and types
Arguments
- .data
An object of class
ir.- ...
<
tidy-select> One or more unquoted expressions separated by commas. Variable names can be used as if they were positions in the data frame, so expressions likex:ycan be used to select a range of variables.
Value
.data with the selected columns. If the spectra column is dropped,
the ir class is dropped, else the object is of class ir.
See also
Other tidyverse:
arrange.ir(),
distinct.ir(),
extract.ir(),
filter-joins,
filter.ir(),
group_by,
mutate,
mutate-joins,
nest,
pivot_longer.ir(),
pivot_wider.ir(),
rename,
rowwise.ir(),
separate.ir(),
separate_rows.ir(),
slice,
summarize,
unite.ir()
Examples
## select
dplyr::select(ir_sample_data, spectra)
#> # A tibble: 58 × 1
#> spectra
#> * <named list>
#> 1 <tibble [3,351 × 2]>
#> 2 <tibble [3,351 × 2]>
#> 3 <tibble [3,351 × 2]>
#> 4 <tibble [3,351 × 2]>
#> 5 <tibble [3,351 × 2]>
#> 6 <tibble [3,351 × 2]>
#> 7 <tibble [3,351 × 2]>
#> 8 <tibble [3,351 × 2]>
#> 9 <tibble [3,351 × 2]>
#> 10 <tibble [3,351 × 2]>
#> # ℹ 48 more rows
dplyr::select(ir_sample_data, holocellulose) # drops ir class
#> # A tibble: 58 × 1
#> holocellulose
#> * [1]
#> 1 0.308
#> 2 0.250
#> 3 0.336
#> 4 0.184
#> 5 0.309
#> 6 0.335
#> 7 0.241
#> 8 0.125
#> 9 0.252
#> 10 0.349
#> # ℹ 48 more rows