r 使用R在DB中创建表

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了r 使用R在DB中创建表相关的知识,希望对你有一定的参考价值。

library(RPostgreSQL)  # 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 = "osd_analysis", host = "localhost", port = 5432)  
dbWriteTable(con, c("osd_analysis", "bgc_graph_c1_metadata"), value=dt,overwrite=TRUE,row.names=FALSE)

以上是关于r 使用R在DB中创建表的主要内容,如果未能解决你的问题,请参考以下文章