% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/process_cif_files.R
\name{aggregate_batch_results}
\alias{aggregate_batch_results}
\title{Aggregate Batched Analysis Results}
\usage{
aggregate_batch_results(input_dir, cols_to_keep = NULL)
}
\arguments{
\item{input_dir}{The directory containing RDS files from \code{analyze_cif_files}.}

\item{cols_to_keep}{Optional character vector of column names to keep.}
}
\value{
A single \code{data.table} containing the aggregated results.
}
\description{
Reads all \code{batch_*.rds} files from a directory and combines them.
}
\examples{
\donttest{
cif_path <- system.file("extdata", "1590946.cif", package = "crystract")
if (file.exists(cif_path)) {
  old_threads <- data.table::setDTthreads(2)
  out_dir <- file.path(tempdir(), "cif_batches")
  analyze_cif_files(cif_path, output_dir = out_dir)

  aggr <- aggregate_batch_results(out_dir)

  unlink(out_dir, recursive = TRUE)
  data.table::setDTthreads(old_threads)
}
}
}
