Get tables of dataset subject category and subject. The subject table
contains subject IDs, which are useful to request specific records in the
dataset table using bps_dataset()
.
bps_subject_category()
requests the subject category tablebps_subject()
requests the subject table
Arguments
- 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.
- subject_category_id
The subject category ID. Use
bps_subject_category()
to see the list of subject category IDs.
Value
bps_subject_category()
returns a tibble containing subject category IDs and titles.bps_subject()
returns a tibble containing subject IDs and titles, as well as subject categories.
Examples
# Look up the subject category
bps_subject_category(lang = "eng")
#> # A tibble: 4 × 2
#> subject_category_id title
#> <chr> <chr>
#> 1 0 Other
#> 2 1 Social and Population
#> 3 2 Economic and Trade
#> 4 3 Agriculture and Mining
# Look up the subjects in the economic and trade category
bps_subject(subject_category_id = "2", lang = "eng")
#> # A tibble: 10 × 5
#> subject_id title subject_category_id subject_category ntabel
#> <chr> <chr> <chr> <chr> <lgl>
#> 1 151 Climate 1 Social and Popu… NA
#> 2 5 Consumption and Expen… 1 Social and Popu… NA
#> 3 28 Education 1 Social and Popu… NA
#> 4 6 Employment 1 Social and Popu… NA
#> 5 152 Enviromental 1 Social and Popu… NA
#> 6 40 Gender 1 Social and Popu… NA
#> 7 153 Geography 1 Social and Popu… NA
#> 8 101 Government 1 Social and Popu… NA
#> 9 30 Health 1 Social and Popu… NA
#> 10 29 Housing 1 Social and Popu… NA