Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco De Lucia
RedModRphree
Commits
8466b872
Commit
8466b872
authored
May 06, 2021
by
Marco De Lucia
Browse files
Fixed n/nval in Distribute
parent
afcae1e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
R/Rphree_Utils.R
View file @
8466b872
### Utility functions for RedModRphree
### Utility functions for RedModRphree
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-0
4-29 20:17
:4
7
delucia"
### Time-stamp: "Last modified 2021-0
5-06 16:05
:4
0
delucia"
##' Replicates an input buffer containing only one SOLUTION, taking
##' Replicates an input buffer containing only one SOLUTION, taking
##' care of SOLUTION/KINETICS/PURE identifiers. Eventually insert a
##' care of SOLUTION/KINETICS/PURE identifiers. Eventually insert a
...
@@ -176,7 +176,7 @@ Distribute <- function(input, prop, values, newname=NULL, first=NULL, wholeline=
...
@@ -176,7 +176,7 @@ Distribute <- function(input, prop, values, newname=NULL, first=NULL, wholeline=
## check how many lines contain the property we want to distribute
## check how many lines contain the property we want to distribute
nsim
<-
length
(
proplines
<-
grep
(
paste0
(
"^"
,
reg
,
" "
),
input
))
nsim
<-
length
(
proplines
<-
grep
(
paste0
(
"^"
,
reg
,
" "
),
input
))
if
(
n
!=
nsim
&&
nsim
!=
1
)
{
if
(
n
val
!=
nsim
&&
nsim
!=
1
)
{
stopmsg
(
"Lengths of simulation and values do not agree"
)
stopmsg
(
"Lengths of simulation and values do not agree"
)
}
}
...
@@ -189,7 +189,7 @@ Distribute <- function(input, prop, values, newname=NULL, first=NULL, wholeline=
...
@@ -189,7 +189,7 @@ Distribute <- function(input, prop, values, newname=NULL, first=NULL, wholeline=
linesave
<-
paste
(
dum
[
3
:
length
(
dum
)],
collapse
=
" "
)
linesave
<-
paste
(
dum
[
3
:
length
(
dum
)],
collapse
=
" "
)
}
}
## if the simulation is just 1, then repeat it n times (adding "first")
## if the simulation is just 1, then repeat it n times (adding "first")
newinp
<-
RepSol
(
input
,
n
)
newinp
<-
RepSol
(
input
,
n
val
)
nsim
<-
length
(
proplines
<-
grep
(
paste0
(
"^"
,
reg
,
" "
),
newinp
))
nsim
<-
length
(
proplines
<-
grep
(
paste0
(
"^"
,
reg
,
" "
),
newinp
))
}
else
{
}
else
{
newinp
<-
input
newinp
<-
input
...
...
Write
Preview
Supports
Markdown
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