library(arrayop) auth = yaml::yaml.load_file("~/.scidb_auth") conn = arrayop::db_connect(host = "localhost", username = auth[["user-name"]], token = auth[["user-password"]])
Check if temporary arrays are auto deleted after R's gc()
conn = arrayop::get_default_connection() listArrays = conn$afl_expr("list()")
# Run this before and after `gc()` listArrays$filter((name %starts_with% 'Rarray' ) || (name %contains% 'test|R_array'))$to_df()
gc()
tempArrayNames = listArrays$filter((name %starts_with% 'Rarray' ) || (name %contains% 'test|R_array'))$to_df()$name for(name in tempArrayNames){ conn$execute(afl(name | remove)) }
testArrays = dbutils$list_arrays_in_ns()$filter(name %starts_with% "test_")$select("name")$to_df() testArrays testArrays$name %>% sapply(., function(x) conn$execute(afl(x | remove)))
buildAfl = conn$array_op_from_build_literal(head(mtcars), skip_scidb_schema_check = T) storedRegular = conn$array_op_from_stored_afl(buildAfl$to_afl(), .gc = F) storedTemp = conn$array_op_from_stored_afl(buildAfl$to_afl(), .temp = T, .gc = F) storedRegular$array_meta_data() storedTemp$array_meta_data() # storedRegular$remove_self() # storedTemp$remove_self()
storedRegular$select("hp", "vs")$to_df() derived = storedRegular$reshape(list("hp", "vs", "sum" = "hp + vs")) derived$to_afl() derived$get_field_types(.strict = F) derived$to_schema_str() storedRegular$to_schema_str() storedRegular$.private$reshape_attrs(c("mpg", "carb", extra="mpg + gear"))$to_afl() storedRegular$.private$reshape_attrs(c("carb", mpg="mpg + gear"))$to_afl() storedRegular$reshape(list("hp", "vs", "sum" = "hp + vs"))$to_df()
devtools::load_all(export_all = F) auth = yaml::yaml.load_file("~/.scidb_auth") conn = arrayop::connect(host = "localhost", username = auth[["user-name"]], token = auth[["user-password"]]) arrayCO2 = conn$array_op_from_name("CO2") arrayCO2$to_df()
grouped = arrayCO2$group_by("Plant_id", "Type") arrayCO2$.private$metaList$group_by_fields grouped$.private$metaList$group_by_fields summarized = grouped$summarize("max(conc)", "alias_min_uptake" = "min(uptake)", "max(Treatment)") # summarized = grouped$summarize("max(conc)", "min(uptake)", "max(Treatment)") str(summarized) summarized$to_df() summarized$filter(alias_min_uptake > 12)$to_df_attrs()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.