Skip to contents

Subset columns in ir objects using column names and types

Usage

select.ir(.data, ...)

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 like x:y can 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.

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]>
#> # … with 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
#> # … with 48 more rows