Попробуйте пакет RPostgreSQL
Пример: -
library(RPostgreSQL)
library(dplyr)
library(dbplyr)
psql <- DBI::dbDriver("PostgreSQL")
con <- DBI::dbConnect(psql,
dbname = "machine_db",
host = "192.168.13.213",
port = 5432,
user = "user",
password = 'user123')
machine_data <- dbGetQuery(con, "SELECT * from machine_db")