# Create a temporary directory and initialise database
temp_dir <- tempdir()
data_path <- file.path(temp_dir, "boilerplate_appendix_example", "data")
# Initialise with default appendix content
boilerplate_init(
categories = "appendix",
data_path = data_path,
create_dirs = TRUE,
create_empty = FALSE,
confirm = FALSE,
quiet = TRUE
)
# Import all databases
unified_db <- boilerplate_import(data_path = data_path, quiet = TRUE)
# Get all appendix sections
appendix_db <- boilerplate_appendix(unified_db)
names(appendix_db)
# Get a specific appendix section (if it exists)
if ("appendix" %in% names(unified_db) && length(unified_db$appendix) > 0) {
section_names <- names(unified_db$appendix)
if (length(section_names) > 0) {
first_section <- boilerplate_appendix(unified_db, section_names[1])
}
}
# Clean up
unlink(file.path(temp_dir, "boilerplate_appendix_example"), recursive = TRUE)
Run the code above in your browser using DataLab