Using RStudio Professional Drivers#
You will use the
odbc R package to access your database with R. Installing
odbc will also install
DBI, the database interface for R.
From an R prompt, install the
On Linux, the odbc R package requires the following system dependencies in Linux:
- GCC 4.8 or later
On older versions of RHEL, you can install GCC 4.8 with RedHat Developer Toolset:
$ sudo yum install devtoolset-4-gcc-c++
Test your connection in R with
odbc::odbc(). If you are using
the RStudio IDE, you can use the
New Connection dialog to help you write the
connection string, for example:
> con <- DBI::dbConnect(odbc::odbc(), Driver = "Driver Name", Database = "Database", UID = "User", PWD = "Password", Server = "Server", Port = 5432)
Visit db.rstudio.com for best practices, examples, and additional configurations to use when working with databases and the RStudio Professional Drivers.
Refer to Troubleshooting RStudio Professional Drivers for additional information on troubleshooting the Connections pane in the RStudio IDE.