The first release on CRAN since 1.1.0. Version 2.0.0 was published
only on GitHub; all its changes are included here.
MIGRATION.md on GitHub explains the upgrade from 1.x.
allow_large_requests = TRUE;
above 250,000 it is always refused, with nothing sent to Fedstat (error
class fedstat_too_large).
fedstat_data_load_with_filters() and
fedstat_post_data_ids_filtered() gain
allow_large_requests as their last argument.
fedstat_download() splits larger selections into
parts.try_to_parse_ObsValue = TRUE now reliably raises an
error for values that are not numbers; in 1.x this check could silently
pass. Use FALSE to keep values such as "..."
as text.fedstat_download() downloads an indicator in small
parts, one request at a time with pauses, and saves every finished part
to disk. Fedstat builds every combination of the selected filter values,
so large selections are split into parts of at most
max_nominal_cells_request combinations (50,000 by default).
If a run stops (time allowance, Fedstat outage, closed R), running the
same call again continues with the remaining parts.max_nominal_cells_request is the main setting for speed
and reliability: if parts keep failing, use 20,000 or 10,000; indicators
with mostly empty combinations download faster with larger parts.fedstat_download("31074", filters) works positionally:
indicator_id, filters and
cache_dir come first, then httr settings in
....cache_dir is optional. Without it, the folder is named
after the indicator and the filters, so the same call resumes there. In
an interactive session you are asked once whether to create it in the
current folder; scripts use R’s temporary folder.max_nominal_cells_request.preview_first = TRUE asks Fedstat to show each part’s
table before downloading it, like pressing “Apply” on the website.fedstat_collect() builds the table from a finished
download. ObsValue is numeric by default; if a value is not
a number, it stops and names it
(try_to_parse_ObsValue = FALSE returns text).fedstat_cleanup() deletes the saved parts after you
have saved the table.download.log without
tokens, cookies or response bodies.fedstat_show_filters() lists the filters of an
indicator with their number of values and examples, and prints a
filters <- list(...) ready to copy: the selection the
website shows when the page opens. It also returns that list.fedstat_dictionary() returns the full SDMX code lists
of an indicator (every code and name of every classification) without
choosing filters. It downloads a small sample, starting with the
website’s opening selection and trying a few small random ones if that
has no data. When no sample has data, the error has class
fedstat_no_data.fedstat_get_data_ids() keeps the website’s opening
selection in the fedstat_default_selection attribute; its
columns are unchanged.fedstat_data_load_with_filters() still works for small
selections. It sends the whole selection as one request, which is slow
for large selections and heavy for Fedstat. Up to 50,000 combinations it
shows a deprecation message once per session; above that it warns on
every call (class fedstat_deprecated). Use
fedstat_download() and fedstat_collect()
instead, and fedstat_dictionary() instead of
return_type = "dictionary".All 1.x functions keep their names, existing arguments and defaults.
retry_max_times in
fedstat_data_load_with_filters() counts whole attempts;
retries are no longer nested and permanent errors stop immediately.... apply to every request,
including token renewal. httr::set_config() and
options(fedstatAPIr.config = ...) are respected.fedstat_error)
with the failed step in e$stage and the HTTP status in
e$status. Messages no longer include response bodies, which
may contain tokens.MIGRATION.md explains upgrading from 1.x."*" to explicitly select all values for a filter field.
Single-value-only filters are still auto-selected. The error message
lists all unspecified fields with an example of how to fix them./indicator/data.do to
/indicator/downloadData.do. All download functions updated
automatically – no user code changes required.ObsValues ->
ObsValue in fedstat_parse_sdmx_to_table() that
caused the numeric parsing safety check to silently never fire.fedstat_data_load_with_filters() now automatically
retries the full download pipeline (GET + filter + POST) on transient
failures, re-fetching a fresh CSRF token on each attempt.fedstat_get_data_ids() and passed through the pipe chain
via data.frame attributes.httr::handle(), also passed as a data.frame
attribute.fedstat_parse_sdmx_to_table() now detects HTML error
pages before attempting XML parsing, giving clearer error messages.fedstatAPIr/1.1.0) is now set
by default. Users can override via ... arguments or
httr::set_config().fedstat_post_data_ids_filtered() no longer retries POST
requests internally (CSRF tokens are single-use). Use the wrapper
fedstat_data_load_with_filters() for automatic retries, or
re-run from fedstat_get_data_ids() when using individual
functions.fedstat_indicators_names_database (5224
indicators, new schema: department, group, id, title, hidden).return_type to
fedstat_parse_sdmx_to_table, obervation value in data is
now parsed from character to numeric type automaticallyfedstat_check_data_update,
fedstat_prepare_reference_data_for_check_data_update), were
experemental, too complex and not a main part of a packagefedstat_get_data_ids_special_cases_handle, no longer needed
due to change of upstream APIfedstat_indicator_info - allows to update
database of all indicators by user