Created
November 6, 2013 17:11
-
-
Save iambibhas/7340128 to your computer and use it in GitHub Desktop.
Just the basic commands to connect to a PostgreSQL database from R and read a table or a query.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(RPostgreSQL) | |
drv <- dbDriver("PostgreSQL") | |
con <- dbConnect(drv, dbname="test", host="localhost", user="test", password="") | |
rs <- dbSendQuery(con, "select * from schools_school") | |
dframe <-dbReadTable(con,"schools_school"). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment