Learn R Programming

albatross (version 0.1-1)

plot.feemparafac: Plot components of fitted PARAFAC model

Description

Plot the factors of a fitted PARAFAC model as functions of emission and excitation wavelengths.

Usage

# S3 method for feemparafac
plot(x, type = c("image", "lines"), ...)

Arguments

x

An object returned by feemparafac.

type

Given a fitted PARAFAC model:

$$% X_{ijk} = \sum_r A_{ir} B_{jr} C_{kr}$$

With \(\mathbf{A}\) corresponding to fluorescence emission spectra, \(\mathbf{B}\) corresponding to fluorescence excitation spectra, and \(\mathbf{C}\) corresponding to the scores of the components in different samples, the following plots can be produced:

"image"

Plot the factors (“loadings”) as a series of false-colour images of outer products \(\mathbf{A}_r \otimes \mathbf{B}_r\).

"lines"

Plot the factors \(\mathbf A_r\) and \(% \mathbf B_r\) as functions of wavelengths, with each pair of factors on a different panel.

More plot kinds may be added in the future.

Passed as-is to lattice functions levelplot and xyplot.

Value

A lattice plot object. Its print or plot method will draw the plot on an appropriate plotting device.

Details

The function provides sane defaults for lattice options such as xlab, ylab, as.table, auto.key, type, cuts, col.regions, but they can be overridden.

See Also

levelplot, xyplot.

Examples

Run this code
# NOT RUN {
  data(feems)
  cube <- feemscale(
    feemscatter(
      feemcube(feems, FALSE)[(1:45)*4,(1:13)*4,],
      rep(24, 4)), na.rm = TRUE
  )

  factors <- feemparafac(cube, nfac = 2, const = rep('nonneg', 3))
  plot(factors, 'image')
  plot(factors, 'line')
# }

Run the code above in your browser using DataLab