db_create: Create parameter database

View source: R/db_create.R

db_createR Documentation

Create parameter database

Description

Function creates tables in a pre-defined database to store parameters relevant for modelling applications with the WASA model.

Usage

db_create(dbname, overwrite = NULL, keep_tables = NULL, db_ver = Inf)

Arguments

dbname

Name of the data source (DSN) registered at ODBC. See Details.

overwrite

c(NULL,"drop","empty"). Delete and re-create ("drop") or empty ("empty") any tables already existing in db. Default: NULL (keep all existing tables). In any case, tables included in keep_tables remain untouched.

keep_tables

Vector of type character. Preserves the specified tables, if existing. Overrides overwrite. Default: NULL.

db_ver

numeric. If Inf (default) the database will be updated to the latest version calling db_update internally. Otherwise, the specified version is created. The earliest possible version is 19.

Details

This package uses the ODBC interface to connect to a database. Creating the database requires the following prior steps which are OS dependent:

  • Install a Database Management System and respective ODBC-driver and on your computer. Currently supported (tested) are: SQLite (v. 3.8.9), MariaDB/MySQL (v. 10.0.17), MS Access.

  • Register an empty database at your ODBC configuration.

Calling db_create creates the necessary tables in the database. These are then filled and processed by subsequent function of lumpR. More information can be found at the lumpR package wiki: https://github.com/tpilz/lumpR/wiki

Author(s)

Tobias Pilz tpilz@uni-potsdam.de, Till Francke francke@uni-potsdam.de

References

lumpR package introduction with literature study and sensitivity analysis:
Pilz, T.; Francke, T.; Bronstert, A. (2017): lumpR 2.0.0: an R package facilitating landscape discretisation for hillslope-based hydrological models. Geosci. Model Dev., 10, 3001-3023, doi: 10.5194/gmd-10-3001-2017


tpilz/lumpR documentation built on Aug. 5, 2023, 1:31 a.m.