Learn R Programming

metabodecon (version 1.6.2)

plot_spectrum_superposition_save_as_png: Plot spectrum approx for variable range

Description

Plots the original spectrum and the superposition of all generated Lorentz curves and saves the result as png under the specified filepath.

Superseded by plot_spectrum() since metabodecon v1.2.0. Will be replaced with v2.

[Deprecated]

Usage

plot_spectrum_superposition_save_as_png(
  deconv_result,
  x_range = c(),
  y_range = c(),
  out_dir = ".",
  ask = TRUE
)

Value

NULL, called for side effects.

Arguments

deconv_result

Saved result of the MetaboDecon1D() function

x_range

Row vector with two entries consisting of the ppm start and the ppm end value to scale the range of the x-axis (optional)

y_range

Row vector with two entries consisting of the ppm start and the ppm end value to scale the range of the y-axis (optional)

out_dir

Path to the directory where the png files should be saved. Default is the current working directory.

ask

Logical value. Whether to ask for confirmation from the user before writing files to disk.

Author

2020-2021 Martina Haeckl: initial version.

See Also

MetaboDecon1D(), calculate_lorentz_curves(), plot_triplets(), plot_lorentz_curves_save_as_png()

Examples

Run this code
sim <- metabodecon_file("bruker/sim_subset")
sim_decon <- generate_lorentz_curves_sim(sim)
png_dir <- tmpdir("sim_decon/pngs", create = TRUE)
plot_spectrum_superposition_save_as_png(sim_decon, out_dir = png_dir, ask = FALSE)
dir(png_dir, full.names = TRUE)

Run the code above in your browser using DataLab