TDIConnector | R Documentation |
TDIConnector instantiates class 'TDIConnector' to manage connection(s). It's purpose is to establish connection(s) to access API(s) for qualitative data.
Setup and provide an API connection.
TDIConnector(source = "yahoo")
source |
API driver class name. |
An object of class TDIConnector
(inherits from R6
) of length 3.
The 'TDIConnector' connects with an API through its driver identified by 'source' (class). It's 'connect()' method establishes the API access via the 'TDIDriver', and returns that connection as an object of class 'TDIConnection'.
The class implements the **singleton pattern** to re-use *open* connections. This is achieved by directly instantiating the class. APIs can use this to pre-load settings.
An object of class 'TDIConnection'.
# TDI library creates an singleton object of class `TDIConnector`.
# It's `connect()` method is to be used to establish a connection,
# that facilitates the API request.
con <- TDI::TDIConnector$connect(source = "yahoo")
msft <- con$getChart(symbol = "MSFT")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.