update_reports_metadata.RdReads a new or updated version of the SITUAS API reports Excel file and updates the internal package metadata. This function is useful when ISTAT adds new reports to the SITUAS API or when you have an updated version of the reports list.
update_reports_metadata(
excel_path = NULL,
save_to_package = TRUE,
verbose = TRUE
)Character string. Path to the Excel file containing the
updated SITUAS reports list. If NULL (default), uses the file in the
package's data-raw directory (data-raw/situas_api.xlsx).
Logical. If TRUE (default), saves the updated metadata
to the package's internal data file (R/sysdata.rda). If FALSE,
only returns the processed metadata without saving. Set to FALSE if you
don't have write permissions to the package directory.
Logical. If TRUE (default), prints informative messages about the update process.
A data.table containing the processed reports metadata with columns:
Integer. Report ID (function number)
Character. Full title of the report in Italian
Character. Validity period of the report
Character. Type of temporal analysis (DATA, PERIODO, or ATTUALIZZAZIONE)
Character. Additional information about the report
The Excel file must have the following columns (in Italian):
Id report: Report ID number (integer)
Titolo report: Full title of the report
Inizio/fine validita' report: Date range in format DD/MM/YYYY - DD/MM/YYYY
Analisi temporale: Analysis type (DATA, PERIODO, or ATTUALIZZAZIONE)
Informazioni: Additional information (optional)
Note: Column names may appear with dots instead of spaces (e.g., "Id.report") due to R's data frame naming conventions.
if (FALSE) { # \dontrun{
# Update from the default package Excel file
new_metadata <- update_reports_metadata()
# Update from a custom Excel file (without saving to package)
custom_metadata <- update_reports_metadata(
excel_path = "path/to/my_situas_reports.xlsx",
save_to_package = FALSE
)
# Update silently
update_reports_metadata(verbose = FALSE)
} # }