r - 使用 RPostgreSQL 从 R 中的数据框创建临时表

标签 r postgresql

我有一个数据框,我需要使用 RPostgreSQL 包在 R 中将其写为临时表

例子:

>data(USArrests)
#Assuming that we have already established a connection to the postgres db
#Let conn be the postgres connection object
>dbWriteTable(conn, "temp_table_data", USArrests, temp.table=TRUE)

这是行不通的。参数 temp.table 似乎被忽略了。

如果没有办法处理 dbWriteTable,是否有办法将数据框写入临时表?

最佳答案

你可以使用参数 is.temp = TRUE 并且有效

关于r - 使用 RPostgreSQL 从 R 中的数据框创建临时表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12797909/

相关文章:

推荐系统 - 将交易计数转换为星级评级

r - 非对等连接的结果中的顺序是如何确定的?

R:根据列名部分匹配计算行均值

postgresql - Postgres : Convert TEXT to string or difference between 'abc' vs. 'a' || 'bc'

postgresql - 如何从 libpq 获取 sql 状态?

postgresql - 按数据库中指定的时间运行程序

sql - plpgsql如何将查询结果插入表中?

r - 在 Markdown 中插入带有 R 代码的文本

postgresql - Goroutines 阻塞连接池

r - dplyr::summarise 根据另一列 max 提取值