Commit cb746f9e authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.6.9.6 refactor: replace lapply by NextMethod to classicaly extract elements...

v1.6.9.6 refactor: replace lapply by NextMethod to classicaly extract elements with '['.InputsModel and '['.OutputsModel
Refs #67
Showing with 6 additions and 10 deletions
+6 -10
Package: airGR Package: airGR
Type: Package Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.6.9.5 Version: 1.6.9.6
Date: 2021-01-08 Date: 2021-01-08
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
### 1.6.9.5 Release Notes (2021-01-08) ### 1.6.9.6 Release Notes (2021-01-08)
#### New features #### New features
......
...@@ -113,12 +113,10 @@ ...@@ -113,12 +113,10 @@
i <- as.character(i) i <- as.character(i)
} }
if (is.numeric(i)) { if (is.numeric(i)) {
res <- .ExtractInputsModel(x, i) .ExtractInputsModel(x, i)
} else { } else {
res <- lapply(i, function(name) x[[name, exact = TRUE]]) NextMethod()
names(res) <- i
} }
return(res)
} }
...@@ -161,10 +159,8 @@ ...@@ -161,10 +159,8 @@
i <- as.character(i) i <- as.character(i)
} }
if (is.numeric(i)) { if (is.numeric(i)) {
res <- .ExtractOutputsModel(x, i) .ExtractOutputsModel(x, i)
} else { } else {
res <- lapply(i, function(name) x[[name, exact = TRUE]]) NextMethod()
names(res) <- i
} }
return(res)
} }
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