Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

split

Split a hyperSpec object according to groups split divides the hyperSpec object into a list of hyperSpec objects according to the groups given by f.


Description

The hyperSpec objects in the list may be bound together again by bind ("r", list_of_hyperSpec_objects).

Usage

## S4 method for signature 'hyperSpec'
split(x, f, drop = TRUE)

Arguments

x

the hyperSpec object

f

a factor giving the grouping (or a variable that can be converted into a factor by as.factor)

drop

if TRUE, levels off that do not occur are dropped.

Value

A list of hyperSpec objects.

Author(s)

C. Beleites

See Also

Examples

dist <- pearson.dist (chondro[[]])
dend <- hclust (dist, method = "ward")
z <- cutree (dend, h = 0.15)

clusters <- split (chondro, z)
length (clusters)

# difference in cluster mean spectra
plot (apply (clusters[[2]], 2, mean) - apply (clusters[[1]], 2, mean))

hyperSpec

Work with Hyperspectral Data, i.e. Spectra + Meta Information (Spatial, Time, Concentration, ...)

v0.100.0
GPL (>= 3)
Authors
Claudia Beleites [aut, cre, dtc] (<https://orcid.org/0000-0003-1626-154X>), Valter Sergo [aut], Alois Bonifacio [ctb, dtc], Marcel Dahms [ctb], Björn Egert [ctb], Simon Fuller [ctb], Vilmantas Gegzna [ctb], Rustam Guliev [ctb], Bryan A. Hanson [ctb], Michael Hermes [ctb], Martin Kammer [dtc], Roman Kiselev [ctb], Sebastian Mellor [ctb]
Initial release
2021-09-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.