Learn R Programming

albatross (version 0.1-1)

feemcube: Build a data cube of FEEMs

Description

This function builds tagged 3-dimensional arrays of fluorescence excitation-emission spectra. Given a list of FEEM objects, it can determine the range of their wavelengths. Otherwise, the object is created from the supplied numeric array and vectors of wavelengths and sample names.

Usage

feemcube(x, …)
  # S3 method for list
feemcube(x, all.wavelengths, …)
  # S3 method for array
feemcube(x, emission, excitation, scales, names = NULL, …)

Arguments

x

A list of FEEM objects, possibly named.

Alternatively, a numeric array.

all.wavelengths

Logical, a flag specifying whether to include wavelengths not present in all of the samples. If FALSE, only those wavelength present in all of the samples are included.

emission

Numeric vector of emission wavelengths. Should correspond to the first dimension of the array x.

excitation

Numeric vector of excitation wavelengths. Should correspond to the second dimension of the array x.

scales

Numeric vector of scale factors corresponding to the spectra in the array. Should correspond to the third dimension of the array x. If missing, assumed to be all \(1\).

names

Character vector of names of the samples. Should correspond to the third dimension of the array x.

Additional arguments besides those specified above are not allowed.

Value

A FEEM data cube is a numeric three-dimensional array with the following attributes:

emission

Fluorescence emission wavelengths corresponding to the first dimension of the array, nm.

excitation

Fluorescence excitation wavelengths corresponding to the second dimension of the array, nm.

dimnames

Dimension names, copies of information above. Used only for presentation purposes.

scales

Scale factors of the samples, corresponding to the third dimension of the array. Assumed to be \(1\) missing if not specified by the user.

Details

feemcube.list can be used to build FEEM data cubes from lists of FEEM objects even if their wavelength grids do not exactly match. The missing wavelengths are set to NA.

See Also

[.feemcube

Examples

Run this code
# NOT RUN {
  feemcube(array(1:24, 4:2), 1:4, 1:3) # array form
  feemcube(replicate(2, feem(matrix(1:6, 2), 1:2, 1:3), FALSE), TRUE) # list form
# }

Run the code above in your browser using DataLab