Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting PostgreSQL with R

I'm trying to make a connection to PostgreSQL database in R.

I'm writing this

drv <- dbDriver("PostgreSQL")

But in result i have an error:

Error: Couldn't find driver PostgreSQL. Looked in:
* global namespace
* in package called PostgreSQL
* in package called RPostgreSQL

What am I doing wrong?

like image 637
Alekseev22 Avatar asked Mar 13 '26 15:03

Alekseev22


1 Answers

drv <- DBI::dbDriver("PostgreSQL")

gives me the same error but loading RPostgreSQL

library("RPostgreSQL") 

before making the connection solves it.

like image 145
shoili Avatar answered Mar 16 '26 06:03

shoili



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!