Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
HYCAR-Hydro
airGR
Commits
d4a32e8d
Commit
d4a32e8d
authored
Jan 06, 2021
by
Delaigue Olivier
Browse files
v1.6.8.37 refactor: rename Outputs argument into x in .GetAggregConvertFun
parent
c4d6d7f4
Pipeline
#18870
passed with stages
in 12 minutes and 33 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
d4a32e8d
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.6.8.3
6
Version: 1.6.8.3
7
Date: 2021-01-05
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
...
...
NEWS.md
View file @
d4a32e8d
...
...
@@ -2,7 +2,7 @@
### 1.6.8.3
6
Release Notes (2021-01-05)
### 1.6.8.3
7
Release Notes (2021-01-05)
#### New features
...
...
R/UtilsSeriesAggreg.R
View file @
d4a32e8d
...
...
@@ -36,21 +36,21 @@
Y
=
"yearly"
)
}
.GetAggregConvertFun
<-
function
(
Outputs
)
{
.GetAggregConvertFun
<-
function
(
x
)
{
AggregConvertFunTable
<-
rbind
(
data.frame
(
ConvertFun
=
"mean"
,
Outputs
=
c
(
"Prod"
,
"Rout"
,
"Exp"
,
"SnowPack"
,
"ThermalState"
,
"Gratio"
,
"Temp"
,
"Gthreshold"
,
"Glocalmax"
,
"LayerTempMean"
,
"T"
),
stringsAsFactors
=
FALSE
),
# R < 4.0 compatibility: avoids mixing numeric and factor into numeric
x
=
c
(
"Prod"
,
"Rout"
,
"Exp"
,
"SnowPack"
,
"ThermalState"
,
"Gratio"
,
"Temp"
,
"Gthreshold"
,
"Glocalmax"
,
"LayerTempMean"
,
"T"
),
stringsAsFactors
=
FALSE
),
# R < 4.0 compatibility: avoids mixing numeric and factor into numeric
data.frame
(
ConvertFun
=
"sum"
,
Outputs
=
c
(
"PotEvap"
,
"Precip"
,
"Pn"
,
"Ps"
,
"AE"
,
"Perc"
,
"PR"
,
"Q9"
,
"Q1"
,
"Exch"
,
"AExch1"
,
"AExch2"
,
"AExch"
,
"QR"
,
"QRExp"
,
"QD"
,
"Qsim"
,
"Pliq"
,
"Psol"
,
"PotMelt"
,
"Melt"
,
"PliqAndMelt"
,
"LayerPrecip"
,
"LayerFracSolidPrecip"
,
"Qmm"
,
"Qls"
,
"E"
,
"P"
,
"Qupstream"
),
stringsAsFactors
=
FALSE
)
# R < 4.0 compatibility: avoids mixing numeric and factor into numeric
x
=
c
(
"PotEvap"
,
"Precip"
,
"Pn"
,
"Ps"
,
"AE"
,
"Perc"
,
"PR"
,
"Q9"
,
"Q1"
,
"Exch"
,
"AExch1"
,
"AExch2"
,
"AExch"
,
"QR"
,
"QRExp"
,
"QD"
,
"Qsim"
,
"Pliq"
,
"Psol"
,
"PotMelt"
,
"Melt"
,
"PliqAndMelt"
,
"LayerPrecip"
,
"LayerFracSolidPrecip"
,
"Qmm"
,
"Qls"
,
"E"
,
"P"
,
"Qupstream"
),
stringsAsFactors
=
FALSE
)
# R < 4.0 compatibility: avoids mixing numeric and factor into numeric
)
res
<-
sapply
(
Outputs
,
function
(
i
Outputs
)
{
iRes
<-
AggregConvertFunTable
$
ConvertFun
[
AggregConvertFunTable
$
Outputs
==
iOutputs
]
res
<-
sapply
(
x
,
function
(
i
X
)
{
iRes
<-
AggregConvertFunTable
$
ConvertFun
[
AggregConvertFunTable
$
x
==
iX
]
iRes
<-
ifelse
(
test
=
any
(
is.na
(
iRes
)),
yes
=
NA
,
no
=
iRes
)
# R < 4.0 compatibility
})
return
(
res
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment