小编eri*_*324的帖子

Connecting R to postgreSQL database

I am trying to connect R to a postgreSQL database. He is what I have been trying in R:

require("RPostgreSQL")

pw<- {
  "password"
}

# loads the PostgreSQL driver
drv <- dbDriver("PostgreSQL")
# creates a connection to the postgres database
# note that "con" will be used later in each connection to the database
con <- dbConnect(drv, dbname = "DBname",
                 host = "localhost", port = 5432,
                 user = "user", password = pw)
rm(pw) # removes the password

# check for …
Run Code Online (Sandbox Code Playgroud)

sql postgresql r

6
推荐指数
2
解决办法
6297
查看次数

标签 统计

postgresql ×1

r ×1

sql ×1