Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. # RPostgreSQLインストール
  2. install.packages("RPostgreSQL")
  3. # RPostgreSQL読み込み
  4. require(RPostgreSQL)
  5. # RPostgreSQLを使って、PoststgreSQLに接続
  6. drv <- dbDriver("PostgreSQL")
  7. con <- dbConnect(drv,dbname="dbname",host="localhost",port=5432,user="username",password="password")
  8. # 目的のテーブルがあるか確かめる
  9. dbExistsTable(con, "tablename")
  10. # "TRUE"
  11. # myTableというdataframeにSQLのテーブルを流しこむ
  12. myTable <- dbReadTable(con,"tablename")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement