download_cds: Download data from CDS as a formatted tibble with metadata.

Description Usage Arguments Details Value

Description

This is the main function of the package which allows for easy downloading of data from CDS into your R session. It provides the CDS metadata via attributes "md_ent" and "md_attributes" as tibbles as well, so you can benefit from it when automatizing the analytics tasks.

Usage

1
2
3
4
5
6
7
8
download_cds(
  query,
  cds_instance_name = NULL,
  select = NULL,
  filter = NULL,
  order_by = NULL,
  top = NULL
)

Arguments

query

A character scalar with the odata request for which you wish to download a result. Typically it will be a plural logical name of an entity ("contacts", "accounts", "phonecalls", etc.). It is passed directly in a request so complex queries with odata operators are possible. The only condition is that it has to perform a retrieve operation on a main entity.

cds_instance_name

A character scalar used in initialize_cds_token() to name a CDS instance. Default NULL. If only one cds_token object is present in getOption("cdsR.tokens"), then you do not need to specify this argument.

select

A string or vector of strings with names of attributes you wish to select from an entity. If a vector, all values will be collapsed using "," as separator.

filter

A string or vector of strings with odata filter statements. If vector, all values will be collapsed using " and " simmilarly to dplyr's filter.

order_by

A string or vector of strings expressing entity fields by which you wish to arrange the result. If a vector, all values will be collapsed using "," as separator.

top

A scalar integer determining how many rows of the base entity you wish to retrieve.

Details

Tibbles returned by this function have several properties

Value

A cds_df S3 object, which is essentially a tibble with additional attributes described in the Details section.


jarekkupisz/cdsR documentation built on Dec. 20, 2021, 9:05 p.m.