visualisation-methods-spectra {ASICS} | R Documentation

## Visualisation methods

### Description

Methods available to plot one object in ASICS package.

### Usage

    ## S4 method for signature 'Spectra,ANY'
    plot(x, y, xlim = c(0.5, 10), ylim = NULL, ...)

    ## S4 method for signature 'ASICSResults,ANY'
    plot(x, y, idx = 1, xlim = c(0.5, 10),
      ylim = NULL, pure.library = NULL, add.metab = NULL, ...)

### Arguments

`x` | An object of class Spectra, PureLibrary or ASICSResults.
`y` | Currently not used.
`xlim, ylim` | Boundaries for x and y, respectively.
`...` | Currently not used.
`idx` | Index of the spectrum to plot. Default to 1.
`pure.library` | Pure library used for the quantification. Default to `NULL` (in which case, the library included in the package is used).
`add.metab` | Name of one metabolite to add to the plot. Default to `NULL` (in which case, no pure spectrum added to the plot).

### Value

- A `ggplot` plot of all spectra (or of a subset) on the same figure for Spectra and PureLibrary objects.

- A `ggplot` plot of original and reconstructed spectra of one sample in the same figure for ASICSResults object. In addition, one pure metabolite spectrum (as provided in the reference library) and the deformed one can be superimposed to the plot.

### Examples

    # Import data and create object
    current_path <- system.file("extdata", "example_spectra", package = "ASICS")
    spectra_data <- importSpectraBruker(current_path)
    spectra_obj <- createSpectra(spectra_data)
    spectra_obj <- createSpectra(spectra_data)

    # Plot the spectra
    plot(spectra_obj)

[Package ASICS version 1.0.1 Index]