Learn R Programming

photobiology (version 0.10.17)

sample_spct: Random sample from collection of spectra

Description

A method to extract a random sample of spectra from a collection of spectra or a spectrum object containing multiple spectra in long form.

Usage

sample_spct(x, size = 1)

sample_mspct(x, size = 1, recursive = FALSE)

Value

If x is an object, such as a "filter_spct" object, the returned object is of same class but possibly containing fewer spectra in long form than x.

Arguments

x

generic_spct An object possibly containing multiple spectra.

size

integer The number of spectra to extract, if available.

recursive

logical Sample members of x directly, or first split members containing multiple spectra.

See Also

See sample for the method used for the sampling.