rd_GetData: Function to obtain data from Eikon. Based on the Eikon python...

View source: R/rd_GetData.R

rd_GetDataR Documentation

Function to obtain data from Eikon. Based on the Eikon python function get_data

Description

The function automatically chunks the list of rics into chunks that comply with the api limitations and in the end rebuilds the chunks again into a single data.frame.

Usage

rd_GetData(
  RDObject = RefinitivJsonConnect(),
  rics,
  Eikonformulas,
  Parameters = NULL,
  raw_output = FALSE,
  time_out = 60,
  verbose = FALSE,
  SpaceConvertor = NULL,
  use_field_names_in_headers = FALSE,
  SyncFields = FALSE
)

Arguments

RDObject

Refinitiv Data connection object

rics

a vector containing the instrument RICS

Eikonformulas

a vector containing character string of Eikon Formulas

Parameters

a named key value list for setting parameters, Default: NULL

raw_output

to return the raw list by chunk for debugging purposes, default = FALSE

time_out

set the maximum timeout to the Eikon server, default = 60

verbose

boolean, set to true to print out the actual python call with time stamp for debugging.

SpaceConvertor

converts spaces in variables name into one of the following characters ".", "," , "-", "_", default is NULL

use_field_names_in_headers

boolean return request fieldnames in stead of titles

SyncFields

boolean, synchronize fields over same time axis (only JSON!, because not supported in Python (use GetHistory))

Details

Currently there is a known bug in the reticulate package with large integers. If a request is made that returns large integers the reticulate package will return -1 for these integers. See also this issue https://github.com/rstudio/reticulate/issues/323 or try for yourself as indicated here https://community.rstudio.com/t/large-integer-conversion-from-python-to-r/82568

Value

a data.frame containing data.from Eikon

References

https://developers.refinitiv.com/eikon-apis/eikon-data-api/docs?content=49692&type=documentation_item

Examples

## Not run: 
Refinitiv <- RDConnect(PythonModule = "RD")
ex1 <- rd_GetData(RDObject = Refinitiv, rics = c("MMM", "III.L"),
             Eikonformulas = c("TR.PE(Sdate=0D)/*P/E (LTM) - Diluted Excl*/"
             , "TR.CompanyName"), verbose = TRUE)

ex2 <- rd_GetData( RDObject = Refinitiv, rics = "AAPL.O"
                   , Eikonformulas = "TR.CompanyMarketCap(Sdate=0D)/*Market Cap*/"
                   )

## End(Not run)
## Not run: 
Refinitiv <- RDConnect(PythonModule = "JSON")
ex1 <- rd_GetData(RDObject = Refinitiv, rics = c("MMM", "III.L"),
             Eikonformulas = c("TR.PE(Sdate=0D)/*P/E (LTM) - Diluted Excl*/"
             , "TR.CompanyName"), verbose = TRUE)


## End(Not run)


GreenGrassBlueOcean/RefinitivR documentation built on Feb. 1, 2024, 1:37 a.m.