% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/process_cif_files.R
\name{export_analysis_to_csv}
\alias{export_analysis_to_csv}
\title{Export Analysis Results to a Directory of CSVs}
\usage{
export_analysis_to_csv(analysis_results, output_dir, overwrite = FALSE)
}
\arguments{
\item{analysis_results}{A \code{data.table} object.}

\item{output_dir}{Path to main output directory.}

\item{overwrite}{Logical.}
}
\value{
Invisibly returns output_dir.
}
\description{
Exports analysis results to CSV structure.
}
\examples{
\donttest{
cif_path <- system.file("extdata", "1590946.cif", package = "crystract")
if (file.exists(cif_path)) {
  old_threads <- data.table::setDTthreads(2)
  res <- analyze_single_cif(cif_path)

  out_dir <- file.path(tempdir(), "cif_csvs")
  export_analysis_to_csv(res, output_dir = out_dir)

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