Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

creating temp table from a data frame in R using RPostgreSQL

Tags:

r

postgresql

I have a data frame which I need to write as a temp table in R using RPostgreSQL package.

Example:

>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)

This does not work. The argument temp.table is seemingly ignored.

If there is no way out to deal with dbWriteTable, is there anyway to write a data frame as a temp table ?


1 Answers

you can use the argument is.temp = TRUE and it works

like image 175
Krishna Das Avatar answered Mar 06 '26 13:03

Krishna Das