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"
)

Arguments

results

results from calculations in package forrescalc as a named list of dataframes

repo_path

name and path of local forresdat repository in which results/tables should be saved

metadata_path

path including .xlsx file in which the metadata are stored

push

push commits directly to the remote on GitHub? Default is FALSE (no). (This option can only be used with SSH.)

strict

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

branch from repository forresdat to which the new version should be committed. Default is 'develop'.

Value

No value is returned, data are saved in the specified git repository

Examples

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
)
} # }