The PostgreSQL database server can be accessed from R through the RPostgreSQL library. You can either create a new database, insert data into an existing database, or perform queries on the existing data tables. In this recipe, you will connect R with the PostgreSQL database server and create a table under the postgres database, and insert data into the database.
To connect with the PostgreSQL database server from R, you are required to install the RPostgreSQL library along with its dependencies. The following R code is to used install the necessary libraries to access the PostgreSQL database:
install.packages("RPostgreSQL", dependencies = TRUE)
In this recipe...