df_srdm | R Documentation |
Personal use!. Check whether the data frame meets the requirements of SRDM, and output the basic information of the data to standard output
df_srdm(
df,
database,
table,
replace = FALSE,
append = FALSE,
write_repo = TRUE
)
df |
data.frame for archive |
database |
valid database name |
table |
valid table name |
replace |
logical value. Default is FALSE |
append |
logical value. Default is FALSE |
write_repo |
logical value. Weather write data infomation to SRMD repo. Default is TURE. |
df$ID <- seq_len(nrow(df))
attr(df, "keys") = "ID"
for (i in seq_along(df))
attr(df[[i]], "label") = paste("label:", names(df)[i])
fil <- tempfile("srdm")
df_srdm(df, "test", "mtcars", file = fil, replace = TRUE)
if (interactive()) file.show(fil)
database <- file.path(
ifelse(Sys.getenv("DATA_ARCHIVE") != "",
Sys.getenv("DATA_ARCHIVE"), "~/Data/DBMS"
), "test.sqlite"
)
con <- DBI::dbConnect(RSQLite::SQLite(), database)
DBI::dbListTables(con)
DBI::dbGetQuery(con, "SELECT * FROM mtcars WHERE ID <= 10")
DBI::dbDisconnect(con)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.