I'm new to R
and I'm trying to connect to PostgreSQL using RStudio.
I've installed the RPostgreSQL
and tried the following code:
> library("DBI", lib.loc="~/R/win-library/3.2")
> library("RPostgreSQL", lib.loc="~/R/win-library/3.2")
> con <- dbConnect(dbDriver("PostgreSQL"), dbname="Delta", user="postgres")
Error in postgresqlNewConnection(drv, ...) :
RS-DBI driver: (could not connect postgres@local on dbname "Delta"
I'm not able to connect to the database for some reason. I'm trying to solve this issue for a long time and couldn't figure out how.