Skip to contents


Purpose

elbe1d is an R package originally developed for research purposes that provides, connects, queries and analyses hydrological, morphological and ecological data along the German federal waterway River Elbe.


Use

Initial setup

To reproduce the code and its functionality a few initial steps need to be taken.

  1. Start R and install all software dependencies
install.packages(c("devtools", "testthat", "knitr", "knitcitations",
                   "rmarkdown", "kableExtra", "pkgdown", "DBI", "RSQLite",
                   "RPostgreSQL", "hyd1d", "hydflood", "leaflet", "purrr",
                   "sf", "terra", "link2GI", "rgrass", "raster", "Rdpack"))

Afterwards close R and return to the console.

  1. Clone elbe1d
git clone https://github.com/bafg-bund/elbe1d.git
  1. Set relevant environmental variables in the package directory
echo "hyd1d_datadir=~/.hyd1d" >> elbe1d/.Renviron
echo "hydflood_datadir=~/.hydflood" >> elbe1d/.Renviron
  1. Potentially add credentials for a postgresql database connection
echo '"host";"postgresql.server.org"' >> elbe1d/DB_credentials_elbe1d
echo '"port";"5432"' >> elbe1d/DB_credentials_elbe1d
echo '"dbname";"elbe1d"' >> elbe1d/DB_credentials_elbe1d
echo '"user";"username"' >> elbe1d/DB_credentials_elbe1d
echo '"password";"p@$$w0rd"' >> elbe1d/DB_credentials_elbe1d
  1. Download additional, package-relevant datasets and extract them directly into elbe1d/data-raw
data-raw.zip
wget https://elbe1d.bafg.de/downloads/data-raw.zip -P elbe1d/data-raw/
unzip elbe1d/data-raw/data-raw.zip -d elbe1d/data-raw/
  1. Change into the package directory and automatically download more datasets, check, build and install the package elbe1d. This may take some time.
cd elbe1d
make pkg


Continue development


Continue statistical analysis