Skip to contents

Get tables of dataset variables. Each table contains the variable IDs, which are useful to request specific observations in a dataset using bps_get_dataset().

  • bps_vertical_var() requests the vertical variable table

  • bps_derived_var() requests the derived variable table

  • bps_year() requests the year table

  • bps_period() requests the period table

Usage

bps_vertical_var(
  dataset_id = NULL,
  domain_id = "0000",
  page = NULL,
  lang = c("ind", "eng")
)

bps_derived_var(
  dataset_id = NULL,
  derived_var_group_id = NULL,
  domain_id = "0000",
  page = NULL,
  lang = c("ind", "eng")
)

bps_year(
  dataset_id = NULL,
  domain_id = "0000",
  page = NULL,
  lang = c("ind", "eng")
)

bps_period(
  dataset_id = NULL,
  domain_id = "0000",
  page = NULL,
  lang = c("ind", "eng")
)

Arguments

dataset_id

The dataset ID. Use bps_dataset() to see the list of dataset IDs.

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.

derived_var_group_id

The derived variable group ID. Use bps_derived_var() to see the list of derived variable group IDs.

Value

  • bps_vertical_var() returns a tibble containing vertical variable IDs, names and groups.

  • bps_derived_var() returns a tibble containing derived variable IDs, names and groups.

  • bps_year() returns a tibble containing year IDs and years.

  • bps_period() returns a tibble containing period IDs and periods.

Examples

# Look up the vertical variables in the gross domestic product dataset
bps_vertical_var(dataset_id = "1955", lang = "eng")
#> # A tibble: 10 × 5
#>    vertical_var_id vertical_var       vertical_var_item_id vertical_var_group_id
#>    <chr>           <chr>              <chr>                <chr>                
#>  1 100             1. Household Cons… 1630                 91                   
#>  2 110             a. Food and Bever… 1631                 91                   
#>  3 120             b. Clothing, Foot… 1632                 91                   
#>  4 130             c. Household Hous… 1633                 91                   
#>  5 140             d. Health and Edu… 1634                 91                   
#>  6 150             e. Transportation… 1635                 91                   
#>  7 160             f. Restaurants an… 1636                 91                   
#>  8 170             g. Others          1637                 91                   
#>  9 200             2. Consumption Ex… 1638                 91                   
#> 10 300             3. Government Con… 1639                 91                   
#> # ℹ 1 more variable: vertical_var_group <chr>