Learn R Programming

spectrolab (version 0.0.12)

split.spectra: Split spectra

Description

split a spectra object into a list of spectra according to grouping f.

Usage

# S3 method for spectra
split(x, f, drop = FALSE, ...)

Arguments

x

spectra object

f

factor vector defining the grouping. Must have length nrow(x)

drop

NOT used

...

NOT used

Value

list of spectra

Examples

Run this code
# NOT RUN {
library(spectrolab)
spec = as_spectra(spec_matrix_example, name_idx = 1)
spec_list = split(spec, names(spec))
# }

Run the code above in your browser using DataLab