forresdat
R/save_results_forresdat.R
save_results_forresdat.Rd
This function saves the results from calculations by the forrescalc package
(or any other named list with dataframes) in git repository forresdat
.
List item names will be used to name each of the tables, which contain
as a content the different dataframes.
save_results_forresdat(
results,
repo_path,
metadata_path,
push = FALSE,
strict = TRUE,
branch = "develop"
)
results from calculations in package forrescalc as a named list of dataframes
name and path of local forresdat
repository in which
results/tables should be saved
path including .xlsx file in which the metadata are stored
push commits directly to the remote on GitHub? Default is FALSE (no). (This option can only be used with SSH.)
keep default TRUE to update data without structural changes, change to FALSE only if tables are structurally changed (e.g. additional column, change in sorting order,...)
branch from repository forresdat
to which the new version
should be committed.
Default is 'develop'.
No value is returned, data are saved in the specified git repository
if (FALSE) { # \dontrun{
#make a local clone of forresdat and change path before running
library(forrescalc)
# add path to your local clone of forresdat
path_to_forresdat <- "xxx/forresdat"
# if you don't have a local clone yet, make it:
git2r::clone("https://github.com/inbo/forresdat.git", path_to_forresdat)
# (add path to your own fieldmap database here)
path_to_fieldmapdb <-
system.file("example/database/mdb_bosres.sqlite", package = "forrescalc")
# add path to metadata here
temp <- tempfile(fileext = ".xlsx")
dl <- googledrive::drive_download(
googledrive::as_id("17M_TfOyjpqLzsFqQ_w1DXitzI7tnULR6"),
path = temp, overwrite = TRUE
)
data_regeneration <- load_data_regeneration(path_to_fieldmapdb)
result_regeneration <- calculate_regeneration(data_regeneration)
save_results_forresdat(
results = result_regeneration,
repo_path = path_to_forresdat,
metadata_path = temp
)
} # }