## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>", eval = FALSE)

## -----------------------------------------------------------------------------
# library(dashboardapi)
# 
# meta <- dashboard_search(
#   "Total population (Both sexes)",
#   lang = "en"
# )
# 
# meta[, c(
#   "indicator_code", "name", "cycle_name", "regional_rank_name",
#   "seasonal_name", "unit", "from_time", "to_time"
# )]

## -----------------------------------------------------------------------------
# prefectures <- dashboard_regions(
#   parent_region_code = "00000",
#   lang = "en"
# )
# 
# prefectures[, c("region_code", "region", "level")]

## -----------------------------------------------------------------------------
# population <- dashboard_data(
#   indicator_code = c(population = "0201010000000010000"),
#   region_code = "00000",
#   time_from = "2020CY00",
#   time_to = "2024CY00",
#   cycle = "year",
#   regional_rank = "japan",
#   seasonal = "original",
#   lang = "en"
# )
# 
# population[, c("indicator", "region", "time", "date", "unit", "value")]

## -----------------------------------------------------------------------------
# wide <- dashboard_data(
#   indicator_code = c(
#     population = "0201010000000010000",
#     japanese_population = "0201020000000010000"
#   ),
#   region_code = "00000",
#   time_from = "2020CY00",
#   time_to = "2024CY00",
#   cycle = "year",
#   regional_rank = "japan",
#   seasonal = "original",
#   wide = TRUE
# )

## -----------------------------------------------------------------------------
# dashboard_terms(category = "0201", lang = "en")
# dashboard_events(category = "0201", level = "high", lang = "en")
# dashboard_surveys(query = "Population Census", lang = "en")
# dashboard_codes("cycle")

## -----------------------------------------------------------------------------
# attribution <- dashboard_api_credit("en")
# attribution$source
# attribution$processed
# attribution$credit

