This function saves the results from calculations in the forrescalc package (or any other named list with dataframes) in an Access database. List item names will be used to name each of the tables, which contain as a content the different dataframes.

save_results_access(results, database, remove_tables = FALSE)

Arguments

results

results from calculations in package forrescalc as a named list

database

name of (empty) Access database including path in which results should be saved

remove_tables

overwrite existing tables in database? Default is FALSE, which means tables are not overwritten/deleted unless this parameter is explicitly put on TRUE.

Value

No value is returned, data are saved in the specified database

Examples

if (FALSE) {
#change path before running
library(forrescalc)
data_dendro <-
  load_data_dendrometry("C:/MDB_BOSRES_selectieEls/FieldMapData_MDB_BOSRES_selectieEls.accdb")
data_deadwood <-
  load_data_deadwood("C:/MDB_BOSRES_selectieEls/FieldMapData_MDB_BOSRES_selectieEls.accdb")
result_dendro <- calculate_dendrometry(data_dendro, data_deadwood)
save_results_access(result = result_dendro, database = "C:/db/testdb.accdb")
#Repeating the previous line of code will give an error, because you try to
#overwrite a table that was already saved in the database on the first run.
#To overwrite previously saved tables, use this command:
save_results_access(result = result_dendro, database = "C:/db/testdb.accdb", remove_tables = TRUE)
}