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
Sebastian Ostberg
WM_LPJmL_indicators
Commits
dc2b1ec9
Commit
dc2b1ec9
authored
Nov 19, 2021
by
Sebastian Ostberg
Browse files
fix regular expressions for experiment command line argument
parent
4cd1417d
Changes
1
Show whitespace changes
Inline
Side-by-side
risk_yield_loss.R
View file @
dc2b1ec9
...
...
@@ -252,12 +252,12 @@ if (length(commandArgs(trailingOnly = TRUE)) > 0) {
stop
(
paste
(
"Invalid parameter sowing_scenario:"
,
sQuote
(
scen
)))
}
}
if
(
any
(
grepl
(
"experiment"
,
commandArgs
(
trailingOnly
=
TRUE
))))
{
if
(
any
(
grepl
(
"
^
experiment
=
"
,
commandArgs
(
trailingOnly
=
TRUE
))))
{
param
<-
strsplit
(
grep
(
"experiment"
,
commandArgs
(
trailingOnly
=
TRUE
),
value
=
TRUE
)[
1
],
grep
(
"
^
experiment
=
"
,
commandArgs
(
trailingOnly
=
TRUE
),
value
=
TRUE
)[
1
],
split
=
"="
)
exp
<-
grep
(
"experiment"
,
unlist
(
param
),
invert
=
TRUE
,
value
=
TRUE
)
exp
<-
grep
(
"
^
experiment
$
"
,
unlist
(
param
),
invert
=
TRUE
,
value
=
TRUE
)
if
(
nchar
(
exp
)
>
0
)
{
print
(
paste
(
"Parameter experiment provided as command line argument:"
,
exp
)
...
...
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