Skip to content

KWB-R/kwb.rabimo

Repository files navigation

R-CMD-check pkgdown codecov Project Status CRAN_Status_Badge R-Universe_Status_Badge

kwb.rabimo

The code in this package has been transferred from the C++ code of ABIMO 3.3: Water Balance Model for Urban Areas (https://github.com/KWB-R/abimo/).

Installation

For details on how to install KWB-R packages checkout our installation tutorial.

### Optionally: specify GitHub Personal Access Token (GITHUB_PAT)
### See here why this might be important for you:
### https://kwb-r.github.io/kwb.pkgbuild/articles/install.html#set-your-github_pat

# Sys.setenv(GITHUB_PAT = "mysecret_access_token")

# Install package "remotes" from CRAN
if (! require("remotes")) {
  install.packages("remotes", repos = "https://cloud.r-project.org")
}

# Install KWB package 'kwb.rabimo' from GitHub
remotes::install_github("KWB-R/kwb.rabimo")

Basic usage

# Load Berlin data from the R-wrapper package kwb.abimo
data <- kwb.abimo::abimo_input_2019

# Provide Abimo's default configuration 
abimo_config <- kwb.abimo:::read_config()

# Use the R-wrapper to run Abimo.exe
abimo_result <- kwb.abimo::run_abimo(input_data = data, config = abimo_config)

# Prepare a configuration for R-Abimo, based on the default Abimo configuration
config <- kwb.rabimo::abimo_config_to_config(abimo_config)

# Run R-Abimo, the R-implementation of Abimo in this package
rabimo_result <- kwb.rabimo::run_rabimo(data, config)

# Have a look at the first lines of the result data frames
head(abimo_result)
head(rabimo_result)

# Plot the differences between Abimo and R-Abimo, per variable
for (name in names(abimo_result)[-1L]) {
  x <- abimo_result[[name]]
  y <- rabimo_result[[name]]
  plot(x, y, xlab = "Abimo", ylab = "Rabimo", main = name, asp = 1)
}

Documentation

Release: https://kwb-r.github.io/kwb.rabimo

Development: https://kwb-r.github.io/kwb.rabimo/dev

About

R-Implementation of Water Balance Model Abimo

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages