test_that("scidb data frame", {
skip_if_no_db()
withr::local_options(stringsAsFactors = FALSE)
conn = get_scidb_connection()
dfArray = conn$create_array(dbutils$random_array_name(), "<a:string, b:int32>")
expect_identical(dfArray$array_meta_data()$distribution, "dataframe")
dataContent = data.frame(a = letters[1:2], b = 1:2)
uploaded = conn$upload_df(dataContent, dfArray, .temp = T, .gc = F)
conn$execute(afl(
uploaded$drop_dims("flatten")$transmute(a, b) | append(dfArray)
))
expect_equal(dfArray$to_df(), dataContent)
# Scidb does not seem to support insert data from build'ed array
# buildDf = conn$array_from_df(dataContent, template = "<a:string, b:int32>")
dfArray$remove_array()
uploaded$remove_array()
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.