This function saves the results from calculations in the forrescalc package (or any other named list with dataframes) in a predefined folder. List item names will be used to name each of the tables, which contain as a content the different dataframes.
save_results_csv(results, output_dir)
No value is returned, data are saved in the specified folder
library(forrescalc)
path_to_fieldmapdb <-
system.file("example/database/mdb_bosres.sqlite", package = "forrescalc")
path_to_plotlevel_csv <- getwd()
data_regeneration <- load_data_regeneration(database = path_to_fieldmapdb)
regeneration <- calculate_regeneration(data_regeneration)
save_results_csv(results = regeneration, output_dir = path_to_plotlevel_csv)
files <- list.files()
files <- files[grepl("^reg_by.*\\.csv$", files)]
file.remove(files)
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE