odataR_get_table: Get table in decoded form

Description Usage Arguments Value Remark Examples

Description

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:

Usage

1
2
odataR_get_table(root = odataR_get_root_data(), table_id = NULL,
  query = NULL, typed = T, keepcode = c())

Arguments

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

Value

A data.frame when successful otherwise NULL

Remark

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

Examples

 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)

HanOostdijk/odataR_old documentation built on May 28, 2019, 8:21 a.m.