View source: R/fedstat_post_data_ids_filtered.R
fedstat_post_data_ids_filtered | R Documentation |
Creates a request body from data_ids
and sends it to
https://www.fedstat.ru/indicator/data.do?format=data_format
.
Gets an sdmx or excel with data in binary format.
sdmx raw bytes can be passed to fedstat_parse_sdmx_to_table
to create a
data.frame or to rawToChar
and writeLines
to create an xml file
excel raw bytes can be passed to writeBin
to create an xls file
fedstat_post_data_ids_filtered(
data_ids,
...,
data_format = c("sdmx", "excel"),
timeout_seconds = 180,
retry_max_times = 3,
httr_verbose = NULL
)
data_ids |
data.frame, can be a result of |
... |
other arguments passed to httr::POST |
data_format |
string, one of sdmx, excel |
timeout_seconds |
numeric, maximum time before a new POST request is tried |
retry_max_times |
numeric, maximum number of tries to POST |
httr_verbose |
|
raw bytes (sdmx or excel)
fedstat_parse_sdmx_to_table
## Not run:
# Get data filters identificators for CPI
# filter the data_ids to get data for january of 2023
# for all goods and services for Russian Federation
# POST filters and download data in sdmx format
data <- fedstat_get_data_ids("31074") %>%
fedstat_data_ids_filter(
filters = list(
"Territory" = "Russian Federation",
"Year" = "2023",
"Period" = "January",
"Types of goods and services" = "*"
)
) %>%
fedstat_post_data_ids_filtered()
# Not actual filter field titles and filter values titles because of ASCII requirement for CRAN
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.