After installing the tdplyr package on the client, you can load the tdplyr package, and use the td_create_context() function to establish a connection to the database from the R interface on the client.
- Load the tdplyr package:
library(tdplyr)
- Use td_create_context() to establish a connection to the database:For example, assume that your DSN is called "TDDSN", then from the R command line interface, run the command:
con <- td_create_context("TDDSN")
When your DSN specification contains at least the connection data source name, user name and password information, this command run successfully without any error message.Otherwise, also specify as needed the function string arguments dsn=<data-source-name>, uid=<username>, and pwd=<password>.For example:con <- td_create_context(dsn="TDDSN", uid="user1", pwd="user1",database="TDDB")
- Run the command con to show the details of the connection.