sc_table_class | R Documentation |
R6 Class for all responses of the /table endpoint of the 'STATcube' REST API.
STATcubeR::sc_data
-> sc_table
response
the httr response
raw
the raw response content
annotation_legend
list of all annotations occurring in the data as a data.frame
with
two columns for the annotation keys and annotation labels.
rate_limit
how much requests were left after the POST request for this table was sent?
Uses the same format as sc_rate_limit_table()
.
json
an object of class sc_json
based the json file used in the request
new()
Usually, objects of class sc_table
are generated with
one of the factory methods sc_table()
, sc_table_saved()
or
sc_table_custom()
. If this constructor is invoked directly,
either omit the parameters json
and file
or make sure that they
match with response
.
sc_table_class$new(response, json = NULL, file = NULL, add_totals = FALSE)
response
a response from httr::POST()
against the /table
endpoint.
json
the json file used in the request as a string.
file
the file path to the json file
add_totals
was the json request modified by adding totals via
the add_totals parameter in one of the factory functions (sc_table()
,
sc_table_custom()
). Necessary, in order to also request totals via
the $add_language()
method.
update()
Update the data by re-sending the json to the API. This is still experimental and could break the object in case new levels were added to one of the fields. For example, if a new entry is added to a timeseries
sc_table_class$update()
tabulate()
An extension of sc_tabulate()
with additional
parameters.
sc_table_class$tabulate( ..., round = FALSE, annotations = FALSE, recode_zeros = FALSE )
...
Parameters which are passed down to sc_tabulate()
round
apply rounding to each measure according to the precision provided by the API.
annotations
Include separate annotation columns in the returned table. This parameter is currently broken and needs to be re-implemented
recode_zeros
interpret zero values as missings?
browse()
open the dataset in a browser
sc_table_class$browse()
add_language()
add a second language to the dataset
sc_table_class$add_language(language = NULL, key = NULL)
language
a language to add. "en"
or "de"
.
key
an API key
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.