Downloads ALL cricket data from Cricsheet in a single ZIP file and loads it into the database with optimized batch processing. This is the recommended method for initial setup.
Usage
install_all_bouncer_data(
db_path = NULL,
fresh = FALSE,
match_types = NULL,
genders = NULL,
download_path = NULL,
keep_downloads = FALSE,
batch_size = 500
)Arguments
- db_path
Database path. If NULL, uses default system data directory.
- fresh
Logical. If TRUE, deletes existing database and starts fresh. Default TRUE. Set to FALSE for incremental loading (skips already-loaded matches).
- match_types
Optional character vector to filter match types after download. Examples: c("ODI", "Test", "T20"), c("IPL", "BBL"). If NULL, loads all types.
- genders
Optional character vector to filter genders. Options: "male", "female". If NULL, loads both genders.
- download_path
Path to store downloaded/extracted files. If NULL, uses temp directory.
- keep_downloads
Logical. If TRUE, keeps downloaded JSON files. Default FALSE.
- batch_size
Number of files per database transaction. Default 500.
Details
This function:
Downloads all_json.zip (all formats, all leagues, all genders)
Uses vectorized parsing (~50ms per file vs ~5000ms)
Batch database transactions (100 files per transaction)
Skips already-loaded matches (incremental loading supported)
Examples
if (FALSE) { # \dontrun{
# Update with new matches (default - incremental)
install_all_bouncer_data()
# Fresh start - delete DB and reload everything
install_all_bouncer_data(fresh = TRUE)
# Install only specific match types
install_all_bouncer_data(match_types = c("ODI", "T20"))
# Install only men's international cricket
install_all_bouncer_data(match_types = c("Test", "ODI", "T20"), genders = "male")
} # }
