This is a follow-up to a previously asked question: Copy a list of data.frame(s) to sqlite database using dplyr. Now I want to load data.frames to an sqlite database using dplyr but some of the data.frames have dots in the name. For example,
data(iris)
data(cars)
res <- list("ir.is" = iris, "cars" = cars)
my_db <- dplyr::src_sqlite(paste0(tempdir(), "/foobar.sqlite3"),
create = TRUE)
lapply(seq_along(res), function(i, dt = res) dplyr::copy_to(my_db,
dt[[i]], names(dt)[[i]]))
Error in sqliteSendQuery(conn, statement, bind.data) : error in statement: near "is": syntax error
I think the error is due to lack of quoting in the underlying internal SQL statements.