df2sqlite | R Documentation |
Writes, replace of append a data frame to a database table. At the same time, setting the primary keys of the table.
df2sqlite(df, database, table, keys, replace = FALSE, append = FALSE)
df |
A data frame of values (or coercible to data.frame). |
database |
Database name, which will be converted to a database. If
environment variable |
table |
Table name in the database |
keys |
character vector, primary keys of data.frame df |
append |
logical value, whether append |
reaplace |
logical value, whether replace the |
## Not run:
df <- mtcars
df$ID <- seq_along(nrows(df))
df2sqlite(df, database = "test", table = "mtcars", keys = "ID")
df$ID = df$ID + 100
try(df2sqlite(df, "test", "mtcars", "ID", append = TRUE))
df2sqlite(df, "test", "mtcars", "ID", append = TRUE)
df$ID = df$ID + 100
df2sqlite(df, "test", "mtcars", "ID", replace = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.