% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/HDF5Matrix_import.R
\name{hdf5_import_multiple}
\alias{hdf5_import_multiple}
\title{Import multiple files into HDF5}
\usage{
hdf5_import_multiple(sources, filename, datasets, ...)
}
\arguments{
\item{sources}{Character vector. Paths to files or URLs to import.}

\item{filename}{Character. Path to HDF5 output file.}

\item{datasets}{Character vector. Dataset paths for each source file.
Must be same length as \code{sources}.}

\item{...}{Additional arguments passed to \code{\link{hdf5_import}}}
}
\value{
Named list of \code{HDF5Matrix} objects, one for each imported file.
}
\description{
Imports multiple files into the same HDF5 file, each as a separate dataset.
Useful for batch importing related datasets.
}
\examples{
\donttest{
# Create temporary CSV files
f1 <- tempfile(fileext = ".csv")
f2 <- tempfile(fileext = ".csv")
f3 <- tempfile(fileext = ".csv")
hdf5_file <- tempfile(fileext = ".h5")

write.table(matrix(rnorm(20), 4, 5), f1, sep = ",",
            row.names = FALSE, col.names = TRUE)
write.table(matrix(rnorm(20), 4, 5), f2, sep = ",",
            row.names = FALSE, col.names = TRUE)
write.table(matrix(rnorm(20), 4, 5), f3, sep = ",",
            row.names = FALSE, col.names = TRUE)

mats <- hdf5_import_multiple(
  sources  = c(f1, f2, f3),
  filename = hdf5_file,
  datasets = c("data/exp1", "data/exp2", "data/exp3"),
  sep      = ","
)

dim(mats$exp1)

hdf5_close_all()
unlink(c(f1, f2, f3, hdf5_file))
}

}
