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
eemlistobject.- abslist
An
abslistobject.- filename
A character string, used for file names.
- meta
A
data.framecontaining 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.pngfiles. Seeplot.eemlist()for plotting.- abs_plot
If
NULL, absorbance plots will not be exported. If a plot is provided, it is saved as a.pngfile. Seeplot.abslist()for plotting.- csv
Logical. If
TRUE, processed EEM and absorbance data and metadata are written tooutput_diras.csvfiles.- 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
eemlistabslist: the
abslistreadme: a character vector containing information about the data processing steps
meta: the metadata associated with the samples, may be
NULLif not providedindices: a list of EEMs and absorbance indices, may be
NULLif not providedeem_plot: a list of EEMs plots, may be
NULLif not providedabs_plot: a ggplot2 object of the absorbance data, may be
NULLif 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
