R6 Class for all responses of the /table endpoint of the 'STATcube' REST API.
Super class
STATcubeR::sc_data -> sc_table
Active bindings
responsethe httr response
rawthe raw response content
annotation_legendlist of all annotations occurring in the data as a
data.framewith two columns for the annotation keys and annotation labels.rate_limithow much requests were left after the POST request for this table was sent? Uses the same format as
sc_rate_limit_table().jsonan object of class
sc_jsonbased the json file used in the request
Methods
Inherited methods
Method 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.
Usage
sc_table_class$new(response, json = NULL, file = NULL, add_totals = FALSE)Arguments
responsea response from
httr::POST()against the /table endpoint.jsonthe json file used in the request as a string.
filethe file path to the json file
add_totalswas 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.
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
Method tabulate()
An extension of sc_tabulate() with additional
parameters.
Arguments
...Parameters which are passed down to
sc_tabulate()roundapply rounding to each measure according to the precision provided by the API.
annotationsInclude separate annotation columns in the returned table. This parameter is currently broken and needs to be re-implemented
recode_zerosinterpret zero values as missings?
