Skip to contents

Exports processed EEM and absorbance data, plots, indices, and metadata to a specified output directory. Creates a folder named by filename and saves all specified outputs there.

Usage

export_data(
  eemlist,
  abslist,
  filename,
  meta = NULL,
  indices = NULL,
  eem_plot = NULL,
  abs_plot = NULL,
  csv = FALSE,
  output_dir = NA
)

Arguments

eemlist

An eemlist object.

abslist

An abslist object.

filename

A character string, used for file names.

meta

A data.frame containing sample metadata.

indices

If NULL, indices will not be exported. If a list of indices is provided, it is saved.

eem_plot

If NULL, EEM plots will not be exported. If a list of plots is provided, they are saved as .png files. See plot.eemlist() for plotting.

abs_plot

If NULL, absorbance plots will not be exported. If a plot is provided, it is saved as a .png file. See plot.abslist() for plotting.

csv

Logical. If TRUE, processed EEM and absorbance data and metadata are written to output_dir as .csv files.

output_dir

Path to save the data. Defaults to a temporary directory if not specified.

Value

A list of the processed data which is also saved to the output directory specified. The list contains:

  • eemlist: the eemlist

  • abslist: the abslist

  • readme: a character vector containing information about the data processing steps

  • meta: the metadata associated with the samples, may be NULL if not provided

  • indices: a list of EEMs and absorbance indices, may be NULL if not provided

  • eem_plot: a list of EEMs plots, may be NULL if not provided

  • abs_plot: a ggplot2 object of the absorbance data, may be NULL if not provided

Examples

eem_plots <- plot(example_processed_eems)
abs_plot <- plot(example_processed_abs)

data <- export_data(
  eemlist = example_processed_eems,
  abslist = example_processed_abs,
  filename = "eemanalyzeR_example",
  eem_plot = eem_plots,
  abs_plot = abs_plot,
  meta = metadata
)
#> Data successfully exported to: /tmp/RtmpTSFkJu/eemanalyzeR_example