Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # RPostgreSQLインストール
- install.packages("RPostgreSQL")
- # RPostgreSQL読み込み
- require(RPostgreSQL)
- # RPostgreSQLを使って、PoststgreSQLに接続
- drv <- dbDriver("PostgreSQL")
- con <- dbConnect(drv,dbname="dbname",host="localhost",port=5432,user="username",password="password")
- # 目的のテーブルがあるか確かめる
- dbExistsTable(con, "tablename")
- # "TRUE"
- # myTableというdataframeにSQLのテーブルを流しこむ
- myTable <- dbReadTable(con,"tablename")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement