% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/app-utils.R
\name{.load_dataset}
\alias{.load_dataset}
\title{Translate a set of uploaded file paths to whatever \code{lcmsPlot()} expects}
\usage{
.load_dataset(paths)
}
\arguments{
\item{paths}{A \code{character} vector of full file paths.}
}
\value{
Either a \code{character} vector of paths, a \code{character} scalar path,
or an R object — whichever is appropriate for \code{lcmsPlot()}.
}
\description{
Inspects file extensions to decide how each upload should be handed off
to \code{\link[=lcmsPlot]{lcmsPlot()}}. Pure function, no Shiny — easy to unit-test.
}
\details{
Dispatch:
\itemize{
\item mzML / CDF / raw paths → returned unchanged so \code{lcmsPlot()} can dispatch
them through the existing character-vector path.
\item A single \code{.cdResult} path → returned unchanged; \code{lcmsPlot()} opens the
SQLite connection internally via \code{\link[=is_cd_results_path]{is_cd_results_path()}}.
\item A single \code{.rds} → \code{\link[=readRDS]{readRDS()}}'d and the resulting object returned.
\item A single \code{.RData} / \code{.Rdata} / \code{.rda} → \code{\link[=load]{load()}}'d into a fresh
environment; the first object inheriting from one of
\code{.SUPPORTED_DATA_CLASSES} is returned. Errors with a clear message if
no such object exists.
}

Empty input, unrecognised extensions, or mixed types raise a \code{stop()} so
the caller can surface the message via \code{\link[=.toast_error]{.toast_error()}}.
}
\keyword{internal}
