ids_bulk {wbids} | R Documentation |
Download and Process Bulk Data File for International Debt Statistics
Description
This function downloads a data file from the World Bank International Debt Statistics (IDS), reads and processes the data into a tidy format.
Usage
ids_bulk(
file_url,
file_path = tempfile(fileext = ".xlsx"),
quiet = FALSE,
timeout = getOption("timeout", 60),
warn_size = TRUE
)
Arguments
file_url |
A character string specifying the URL of the Excel file to download. This parameter is required (see ids_bulk_files). |
file_path |
An optional character string specifying the file path where
the downloaded file will be saved. Defaults to a temporary file with |
quiet |
A logical parameter indicating whether messages should be printed to the console. |
timeout |
An integer specifying the timeout in seconds for downloading the file. Defaults to the current R timeout setting. |
warn_size |
A logical parameter indicating whether to warn about large downloads. Defaults to TRUE. |
Value
A tibble containing processed debt statistics data with the following columns:
- geography_id
The unique identifier for the geography (e.g., "ZMB").
- series_id
The unique identifier for the series (e.g., "DT.DOD.DPPG.CD").
- counterpart_id
The unique identifier for the counterpart series.
- year
The year corresponding to the data (as an integer).
- value
The numeric value representing the statistic for the given geography, series, counterpart, and year.
Examples
## Not run:
available_files <- ids_bulk_files()
data <- ids_bulk(
available_files$file_url[1]
)
## End(Not run)