Commit e49640d7 authored by Dorchies David's avatar Dorchies David
Browse files

feat: add run-off model in girop object

Refs #1
Showing with 5 additions and 4 deletions
+5 -4
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#' @export #' @export
#' #'
#' @examples #' @examples
girop <- function(db, cols = c(id = "id", area = "area", params = "params"), keep_all = FALSE) { girop <- function(db, cols = c(id = "id", area = "area", model = "model", params = "params"), keep_all = FALSE) {
colsDefault <- list(id = "id", area = "area", params = "params") colsDefault <- list(id = "id", area = "area", model = "model", params = "params")
cols <- utils::modifyList(colsDefault, as.list(cols)) cols <- utils::modifyList(colsDefault, as.list(cols))
if(!any(names(db) == cols$params)) { if(!any(names(db) == cols$params)) {
# Add missing params column in the database # Add missing params column in the database
......
...@@ -38,6 +38,9 @@ ginetSeine <- ginet(seine_nodes, list(id = "id_sgl", down = "id_aval", length = ...@@ -38,6 +38,9 @@ ginetSeine <- ginet(seine_nodes, list(id = "id_sgl", down = "id_aval", length =
Create the girop object Create the girop object
```{r} ```{r}
# Specify which run-off model to use
seine_nodes$model = "RunModel_GR4J"
# Generate girop object
giropSeine <- girop(seine_nodes, list(id = "id_sgl", area = "area")) giropSeine <- girop(seine_nodes, list(id = "id_sgl", area = "area"))
``` ```
...@@ -69,5 +72,3 @@ for(id in ginetSeine$id) { ...@@ -69,5 +72,3 @@ for(id in ginetSeine$id) {
gitsSeine <- merge(gitsSeine, gits(id, l[[id]], cols = list(date = "Date", Precip = "Ptot", PotEvap = "ETP", Qobs = "Qnat"))) gitsSeine <- merge(gitsSeine, gits(id, l[[id]], cols = list(date = "Date", Precip = "Ptot", PotEvap = "ETP", Qobs = "Qnat")))
} }
``` ```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment