Learn R Programming

Rblpapi (version 0.3.15)

defaultConnection: Return the default connection/authentication objects

Description

These functions return the default connection/authentication objects from the package environment. If no default connection/authentication has been established yet, will return NULL. In the case of authentication, if using a desktop/workstation session, NULL will work fine. If using SAPI/Bpipe, you may need to use blpAuthenticate() to create an authentication object.

Usage

defaultConnection()

defaultAuthentication()

Arguments

Author

Whit Armstrong and Dirk Eddelbuettel

Details

Required arguments can be set via options. See blpConnect and blpAuthenticate for details. In addition, if options blpAutoConnect and/or blpAutoAuthenticate are set to ‘TRUE’, a connection and/or authentication is established in the .onAttach() function and stored in the package environment. This effectively frees users from having to explicitly create such objects. Of course, the user can also call blpConnect and/or blpAuthenticate explicitly and store the connection/authentication objects. These helper functions look up the stored connection/authentications object and return them. In case no connection has been established, an error message is shown. In case no authentication has been established, NULL is returned. (NULL is sufficent for Desktop API connections.)

Examples

Run this code
if (FALSE) {
  con <- defaultConnection()
  blpid <- defaultAuthentication()
}

Run the code above in your browser using DataLab