Description Usage Arguments Value Remark Examples
The main function is odataR_get_table
that extracts the information from the database and decodes the dimensions. It uses the other functions in the package behind the screens.
E.g. when executing df = odataR_get_table(table_id="82935NED")
the following is executed:
get names of sub tables:
subtabs = odataR_get_subtables(table_id="82935NED")
retrieve coded data:
df = odataR_get_subtable(subtabs['TypedDataSet'])
retrieve properties:
props = odataR_get_subtable(subtabs['DataProperties'],mt='prop')
decode dimensions:
df = couple_data(df, ...)
1 2 | odataR_get_table(root = odataR_get_root_data(), table_id = NULL,
query = NULL, typed = T, keepcode = c())
|
root |
Root of data structure |
table_id |
Identification of table |
query |
OData query to restrict data returned from structure |
typed |
Boolean indicating 'TypedDataSet' when T or 'UntypedDataSet' when F' |
keepcode |
Character string with dimension(s) for which the coded values are kept |
A data.frame when successful otherwise NULL
See http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html for details about the query possibilities
$format=atom
is default so can be omitted, but specifying $format=json
will not work in this context
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
df = odataR_get_table(table_id="82935NED")
df = odataR_get_table(table_id="82935NED",keepcode = "RegioS")
df = odataR_get_table(table_id="82935NED",keepcode = c("RegioS","Perioden"))
df = odataR_get_table(table_id="82935NED",keepcode = "RegioS",
query = "?$format=atom&$filter=startswith(RegioS,'NL01')" )
df = odataR_get_table(table_id="82935NED",
query = paste0("?$filter=startswith(RegioS,'NL01')",
"&$select=RegioS,Perioden,TotaleInvesteringen_1") )
df = odataR_get_table(table_id="82935NED",
query = paste0("?$filter=startswith(RegioS,'NL01')",
"&$select=RegioS,Perioden,TotaleInvesteringen_1",
"&$skip=2&$top=3") )
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.