Learn R Programming

BayesianDisaggregation (version 0.1.2)

save_results: Save disaggregation results to disk

Description

Writes CSV extracts and a single Excel workbook with the key outputs from bayesian_disaggregate.

Usage

save_results(res, out_dir)

Value

(Invisibly) the path to the Excel file written.

Arguments

res

A result object returned by bayesian_disaggregate().

out_dir

Directory where files will be written. Created if missing.

Examples

Run this code
# \donttest{
# Usar archivos de ejemplo incluidos en el paquete
cpi_file <- system.file("extdata", "CPI.xlsx", 
                         package = "BayesianDisaggregation")
weights_file <- system.file("extdata", "WEIGHTS.xlsx", 
                            package = "BayesianDisaggregation")

if (nzchar(cpi_file) && nzchar(weights_file)) {
  res <- bayesian_disaggregate(cpi_file, weights_file)
  # Use tempdir() for CRAN compliance
  save_results(res, file.path(tempdir(), "results"))
}
# }

Run the code above in your browser using DataLab