R Studio에서 다음 코드 실행
> install.packages(“DBI”)
> install.packages(“odbc”)
> install.packages(“RPostgreSQL”)
# 설치
> require(“RPostgreSQL”)
>con<-dbConnect(dbDriver(“PostgreSQL”), dbname=”dbname“, host=”localhost”, port=5432, user=”user_name“,password=”password“)
> dbListTables(con)
# 접속
출처 : https://stackoverflow.com/questions/40642657/connecting-r-to-postgresql-database