forresdat
R/from_access_to_forresdat.R
from_access_to_forresdat.Rd
This function loads one or more tables from the access database
(or an SQLite database) and saves them in the git repository forresdat
.
Table names in camel case in the database are renamed to snake case before
saving in forresdat
.
from_access_to_forresdat(
database,
tables,
repo_path,
metadata_path,
push = FALSE,
strict = TRUE,
branch = "develop"
)
name of Fieldmap
/Access database (with specific Fieldmap
structure) including path
vector with table names of tables that should be moved
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, the tables are saved in the 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("12x2H9lp86R-AFPdN2JXB9nqwJ2_A6PF6"),
path = temp, overwrite = TRUE
)
from_access_to_forresdat(
database = path_to_fieldmapdb,
tables = c("qCoverHerbs", "qtotalCover"),
repo_path = path_to_forresdat,
metadata_path = temp
)
} # }