考慮使用dplyr將數據添加到表中,我看到https://stackoverflow.com/a/26784801/1653571,但文檔說db_insert_table()
已被棄用。不能使用dplyr將數據追加到sqlite3 db_write_table()
?db_insert_into()
...
db_create_table() and db_insert_into() have been deprecated in favour of db_write_table().
...
我試圖用非棄用db_write_table()
代替,但既沒有在append=
選項失敗:
require(dplyr)
my_db <- src_sqlite("my_db.sqlite3", create = TRUE) # create src
copy_to(my_db, iris, "my_table", temporary = FALSE) # create table
newdf = iris # create new data
db_write_table(con = my_db$con, table = "my_table", values = newdf) # insert into
# Error: Table `my_table` exists in database, and both overwrite and append are FALSE
db_write_table(con = my_db$con, table = "my_table", values = newdf,append=True) # insert into
# Error: Table `my_table` exists in database, and both overwrite and append are FALSE
如果一個能夠與db_write_table()
追加數據?
也https://github.com/tidyverse/dplyr/issues/3120