Learn R Programming

albatross (version 0.1-1)

feem: Create a fluorescence excitation-emission matrix object

Description

Functions to create fluorescence excitation-emission matrix objects from R matrices coupled with excitation and emission wavelengths or three-column data.frames containing \((\lambda_{em}, \lambda_{ex}, I)\) tuples.

Usage

feem(x, …)
  # S3 method for matrix
feem(x, emission, excitation, scale = 1, …)
  # S3 method for data.frame
feem(
    x, scale = 1, emission = 'emission',
    excitation = 'excitation', intensity = 'intensity', …
  )

Arguments

x

The matrix or three-column data.frame to convert into a FEEM object.

If converting a matrix, its rows should correspond to different fluorescence emission wavelengths specified in emission argument; conversely, its columns should correspond to excitation wavelengths specified in excitation argument.

If converting a data.frame, it should have exactly three columns, one for emission wavelengths, excitation wavelength, and intensity. The names of the columns are expected to be 'emission', 'excitation', and 'intensity', respectively, but can be overridden using namesake arguments.

emission

If conversing a matrix, this should be a vector of emission wavelengths, each wavelength corresponding to a row of the matrix.

If converting a data.frame, this optional argument specifies the name of the column containing the emission wavelengths.

excitation

If conversing a matrix, this should be a vector of excitation wavelengths, each wavelength corresponding to a column of the matrix.

If converting a data.frame, this optional argument specifies the name of the column containing the excitation wavelengths.

intensity

If converting a data.frame, this optional argument specifies the name of the column containing the fluorescence intensities.

scale

The scale value of a EEM is preserved through the analysis procedure to make it easy to undo the scaling after runnining PARAFAC. If the EEM has been pre-multiplied prior to creating the FEEM object, you can set the multiplier here.

Extra arguments besides those specified above are not allowed.

Value

A FEEM object is a matrix with the following attributes added:

emission

Fluorescence emission wavelengths corresponding to the rows of the matrix, nm.

excitation

Fluorescence excitation wavelengths corresponding to the columns of the matrix, nm.

dimnames

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

scale

Scale factor, preserved through the analysis, which may be used later to undo the scaling. Initially \(1\).

See Also

FEEM methods: plot.feem, as.data.frame.feem, [.feem

Examples

Run this code
# NOT RUN {
  feem(matrix(1:40, ncol = 8), 1:5, 1:8)
  feem(
    data.frame(x = 1:10, y = 21:30, z = 31:40),
    emission = 'x', excitation = 'y', intensity = 'z'
  )
# }

Run the code above in your browser using DataLab