Hoping to get a few points by translating Hadley’s useful comment in response. Also, I think there may have been some changes that allow copy_tothis to be done (at least it seems to have worked for me).
data(iris)
remoteDb <- src_postgres(dbname="irisDb",host="remoteDB.somewhere.com",
port=5432,user="yourUser",password="yourPass")
irisSql <- copy_to(remoteDb,iris,"iris_table",temporary=FALSE)
irsSqlPermanent <- compute(irisSql, name="iris_table_permanent", temporary=FALSE)
The first two lines capture the standard "iris" R dataset and establish a connection (in this case, Postgres).
The line copy_touses what appears to be an undocumented argument temporarythat allows the data frame to be stored in the database (found in the error report). The string computealso works as intended, but I'm not sure if you need it temporary=FALSEwith copy_to.
source
share