Skip to contents

Plots the peak triplets for each peak detected by MetaboDecon1D() and stores the plots as png at outdir.

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

[Deprecated]

Usage

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

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

Directory to save the png files (optional)

ask

Logical value to ask the user if the png files should be saved in the specified directory (optional)

Value

No return value, called for side effect of plotting.

Author

Martina Haeckl, 2021: Initial version. Tobias Schmidt, 2024: Minor updates to pass CRAN checks.

Examples

sim <- metabodecon_file("bruker/sim_subset")
sim_decon <- generate_lorentz_curves_sim(sim)
png_dir <- tmpdir("sim_decon/pngs", create = TRUE)
plot_triplets(sim_decon, out_dir = png_dir, ask = FALSE)
#> Plot triplets of sim_01
#> Plot triplets of sim_02
dir(png_dir, full.names = TRUE)
#> [1] "/tmp/RtmpuYVEs7/metabodecon/sim_decon/pngs/sim_01_lorentz_curves.png"    
#> [2] "/tmp/RtmpuYVEs7/metabodecon/sim_decon/pngs/sim_01_peak_triplets.png"     
#> [3] "/tmp/RtmpuYVEs7/metabodecon/sim_decon/pngs/sim_01_sum_lorentz_curves.png"
#> [4] "/tmp/RtmpuYVEs7/metabodecon/sim_decon/pngs/sim_02_lorentz_curves.png"    
#> [5] "/tmp/RtmpuYVEs7/metabodecon/sim_decon/pngs/sim_02_peak_triplets.png"     
#> [6] "/tmp/RtmpuYVEs7/metabodecon/sim_decon/pngs/sim_02_sum_lorentz_curves.png"