Downloads the CSV data files from the OSF repository and caches them locally as RDS files for fast subsequent loading. On first use the function asks for interactive consent before starting the download. In non-interactive sessions, uncached downloads are refused with an informative error.
Details
Downloaded CSV files are read with data.table::fread(), then saved as
compressed RDS in the user's cache directory
(tools::R_user_dir("krpoltext", "cache")). The original CSV is not kept
on disk; only the RDS cache is stored.
File integrity is verified via SHA-256 checksums published with the OSF release.
Examples
if (interactive()) {
# Download everything (asks for consent interactively)
download_data()
# Download only party statements
download_data("party_statements")
# Force re-download
download_data("all", force = TRUE)
}