Releases: groditi/blsR
Releases · groditi/blsR
blsR 0.5.0
New functionality
- Managing the API key can now be done via the
BLS_API_KEYenvironment
variable. This can be done using a.Renvironfile or manually by setting
the key with the newbls_set_keyfunction. Functions which previously
required the argumentapi_keynow default to the result ofbls_set_key get_n_seriesand all functions downstream of it now support automatic
spanning of lists ofseries_idslonger than the API limit by breaking up
the query into multiple API calls.
Other Changes
- Function arguments that previously defaulted to
NAnow default toNULL - Major refactor of documentation
Bug Fixes
get_latest_observation's argument was incorrectly namedsurvey_id
instead ofseries_id
blsR v0.4.0
blsR 0.4.0
- Previously, the
get_n_seriesdocumentation state that...was passed to
query_n_series. This was both inaccurate and inconsistent with the behavior
of the otherget_*functions.get_n_seriesarguments were updated to
capture all of thequery_n_seriesarguments and pass...tobls_request - Previously, calling
get_n_seriesfor only 1 series would fail due to a
json encoding issue stemming from a length 1 vector being coerced to a scalar
withinhttr::POSTinbls_request. - Previously,
data_as_tablewould return a variable number of columns based
on the shape of the input. This led to unpredictable output and caused issues
when merging multiple requests for different time spans. Going forward
data_as_tablewill return a tibble with only 4 columns (year,period,
periodName, andvalue). Users that wish to access aspects, footnotes,
calculations, or the 'latest' flag should useget_n_series. - As a result of the changes to
data_as_table,get_series_tableand
get_n_series_tableno longer include thelatestorfootnotescolumns.
This fixes a condition where requesting aspects for a series without aspects
would cause the table to have zero rows and a condition where thelatest
column could disappear between two identical calls if the data was updated. - Previously, pagination for periods exceeding the API limits was done
automatically in bothget_series_tableandget_series_tables. Pagination
behavior has been renamed to 'spanning', removed from the previous points of
implementation and implemented as three spanning functions following a
map-reduce pattern:span_series_request- encapsulates all of the spanning behaviorspan_request_queries- creates multiple conforming queriesreduce_spanned_responses- merges the results of multiple queries
The spanning behavior is now implemented atget_seriesandget_n_series,
which removes the burden of merging multiple requests from the higher level
get_series_tableandget_n_series_tablefunctions and allows users to
create their own high-level functions to alter the presentation without having
to be aware of the multiple requests. Spanning behavior may be turned off by
setting thespanargument toFALSE.
blsR v0.3.2
blsR 0.3.2
- Previously, if
get_series_tableorget_series_tableswere called for a
date range and series combination with no observations available, an error was
triggered bydata_as_tablefailing. Series and period combinations with no
results now returnNA. get_series_tableandget_series_tablesnow notify if the request is
broken up into multiple API calls.- For requests broken up into multiple API calls,
get_series_tablesnow
merges the results descending order to match the order of the returned data. get_seriesandget_n_seriesnow notify if request returns 0 observationsdata_as_tablethrows an error ifdataargument is empty or not a list.
blsR v0.3.0
blsR 0.3.0
data_as_table,get_series_table,get_series_tables, and
get_n_series_tableall have new optional parameter "parse_values" which
will cast numeric strings into numeric valuesbls_requesthas new optionalprocess_responseargument which gives
users access to the raw API responseget seriesdocumentation improved- Add
tidy_table_as_zoofor users ofzooandxts
v0.2.1
blsR v0.2.0
blsR 0.2.0
- Add warning if attempting to request more than 20 years
- Allow
get_series_tableandget_series_tablesto request more than 20
years of data by making multiple requests - Introduce live tests is
BLS_API_TEST_KEYenv variable is set - Expand documentation
tidy_periodsnow puts month and quarter column after year- Improve README