Search and download datasets that BPS distributes in spreadsheets. The API calls them static tables.
bps_dataset_spreadsheet()
requests the spreadsheet dataset tablebps_download_spreadsheet()
downloads a spreadsheet
Arguments
- keyword
The keyword to filter the search result.
- month
The month in which a spreadsheet is last updated.
- year
The year in which a spreadsheet is last updated.
- domain_id
The domain ID of a BPS bureau. Defaults to "0000", which is the domain ID of the central bureau. Use
bps_domain()
to see the list of domain IDs.- page
The page number of the result. Defaults to page one. Set to
Inf
to request all pages.- lang
The result's language. Must be either "ind" for Indonesian or "eng" for English. Defaults to Indonesian.
- dataset_id
The dataset ID. Use
bps_dataset_spreadsheet()
to see the list of dataset IDs.- file_path
The path to save the spreadsheet. Must have a ".xls" extension.
Value
bps_dataset_spreadsheet()
returns a tibble containing dataset IDs and titles, as well as other related details.bps_download_spreadsheet()
invisibly returns a string of the file path.
File format
The spreadsheet dataset comes in a Microsoft Excel file format with the ".xls" extension.
See also
bps_download()
to download resources by URL.