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
2a58aebd
Commit
2a58aebd
authored
Jun 27, 2021
by
Marco De Lucia
Browse files
Renamed RReadOut* to ReadOut
parent
05d337ff
Changes
8
Hide whitespace changes
Inline
Side-by-side
NAMESPACE
View file @
2a58aebd
...
...
@@ -34,11 +34,11 @@ export(RPhreeExt)
export(RPhreeFile)
export(RPhreeWriteInp)
export(RPinfo)
export(RReadOut)
export(RReadOutKin)
export(RReadOutVal)
export(ReactTranspBalanceEq)
export(ReactTranspBalanceKin)
export(ReadOut)
export(ReadOutKin)
export(ReadOutVal)
export(RecomposeState)
export(ReduceState)
export(RepSol)
...
...
R/Rphree_Files.R
View file @
2a58aebd
### File-related utility functions for RedModRphree
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-0
4
-2
9
1
8:02:02
delucia"
### Time-stamp: "Last modified 2021-0
6
-2
7
1
6:16:16
delucia"
##' Reads a normal PHREEQC input file and prepares it for
...
...
@@ -73,8 +73,8 @@ RPhreeWriteInp <- function(ofile,input)
##' calculation were made with Rphree.
##'
##' Currently all blocks are read. For simulations with kinetics the
##' function to use is \code{\link{
R
ReadOutKin}}.
##' @title
R
ReadOut, parse a PHREEQC output file
##' function to use is \code{\link{ReadOutKin}}.
##' @title ReadOut, parse a PHREEQC output file
##' @param out The PHREEQC output file.
##' @return An output list, as if the simulation would have being run
##' through Rphree (the same blocks and the same names are returned)
...
...
@@ -82,9 +82,9 @@ RPhreeWriteInp <- function(ofile,input)
##' @export
##' @examples
##' \dontrun{
##' out <-
R
ReadOut("ex.out")
##' out <- ReadOut("ex.out")
##' }
R
ReadOut
<-
function
(
out
)
ReadOut
<-
function
(
out
)
{
if
(
length
(
out
)
==
1
)
{
## is it a buffer or a file?
## note that empty lines are removed!
...
...
@@ -247,7 +247,7 @@ RReadOut <- function(out)
##' Kinetics simulation: reads a PHREEQC output file or buffer and
##' forms an output list.
##' @title
R
ReadOutKin, imports the output file of a kinetic
##' @title ReadOutKin, imports the output file of a kinetic
##' simulation into R
##' @param out The PHREEQC output file or buffer
##' @param verbose logical. If TRUE more output is given to the
...
...
@@ -256,7 +256,7 @@ RReadOut <- function(out)
##' "logical block": desc, tot, pphases, species, kin
##' @author MDL
##' @export
R
ReadOutKin
<-
function
(
out
,
verbose
=
FALSE
)
ReadOutKin
<-
function
(
out
,
verbose
=
FALSE
)
{
if
(
length
(
out
)
==
1
)
{
## is it a buffer or a file?
## note that empty lines are removed!
...
...
@@ -414,7 +414,7 @@ RReadOutKin <- function(out, verbose=FALSE)
##' This version looks for a precise valence of an element. It is used
##' primarily by \code{Pourbaix} to track the species and the SIs
##' which must be retained for the diagram.
##' @title
R
ReadOutVal, parse a PHREEQC output file/buffer in search
##' @title ReadOutVal, parse a PHREEQC output file/buffer in search
##' of specific valence state of an element
##' @param out The PHREEQC output file or buffer
##' @param valence the specified element valence, e.g., Fe(2)
...
...
@@ -422,7 +422,7 @@ RReadOutKin <- function(out, verbose=FALSE)
##' "logical block": desc, tot, pphases, species
##' @author MDL
##' @export
R
ReadOutVal
<-
function
(
out
,
valence
)
ReadOutVal
<-
function
(
out
,
valence
)
{
if
(
length
(
out
)
==
1
)
{
## is it a buffer or a file?
## note that empty lines are removed!
...
...
R/Rphree_Pourbaix.R
View file @
2a58aebd
### Licence: LGPL version 2.1
## Time-stamp: "Last modified 2021-0
4
-2
9
1
5:56:47
delucia"
## Time-stamp: "Last modified 2021-0
6
-2
7
1
6:17:00
delucia"
##' @title Revert a string
##' @param x character vector. All element of the vector will be
...
...
@@ -235,7 +235,7 @@ Pourbaix <- function(element,
has_valence
<-
FALSE
if
(
missing
(
element
))
{
utils
::
capture.output
(
res
<-
R
ReadOutVal
(
con
)[[
1
]])
utils
::
capture.output
(
res
<-
ReadOutVal
(
con
)[[
1
]])
selout
<-
FormSelectedOutput
(
res
)
}
else
{
## first we distinguish if we want total amount of element or a specific valence
...
...
@@ -246,10 +246,10 @@ Pourbaix <- function(element,
## strip the parentheses from valence to get the element
element
<-
sub
(
"\\(.*\\)"
,
""
,
valence
)
msg
(
"Restricting the calculation to the oxidation state"
,
valence
)
utils
::
capture.output
(
res
<-
R
ReadOutVal
(
con
,
valence
)[[
1
]])
utils
::
capture.output
(
res
<-
ReadOutVal
(
con
,
valence
)[[
1
]])
selout
<-
FormSelectedOutput
(
res
,
element
)
}
else
{
utils
::
capture.output
(
res
<-
R
ReadOutVal
(
con
)[[
1
]])
utils
::
capture.output
(
res
<-
ReadOutVal
(
con
)[[
1
]])
selout
<-
FormSelectedOutput
(
res
,
element
)
}
}
...
...
R/Rphree_SurrogateUtils.R
View file @
2a58aebd
## Functions for dealing with surrogate simulations
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-0
4
-2
9
1
8:05
:5
3
delucia"
### Time-stamp: "Last modified 2021-0
6
-2
7
1
6:17
:5
2
delucia"
##' Computes the average of absolute values of a vector
##' @title Average of absolute values
...
...
@@ -110,7 +110,7 @@ ExtractTotals <- function(flatlist, totals) {
##' @title Scan a list of Rphree simulations to form stoichiometric
##' matrix
##' @param flatlist a flatted list of Rphree simulations
##' @param db database (as read by
R
ReadFile(..., is.db=TRUE))
##' @param db database (as read by ReadFile(..., is.db=TRUE))
##' @param species vector containing all species to be included in the
##' stoichiometric matrix. If omitted, the flat list is searched
##' for all possible species
...
...
man/
R
ReadOut.Rd
→
man/ReadOut.Rd
View file @
2a58aebd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Rphree_Files.R
\name{
R
ReadOut}
\alias{
R
ReadOut}
\title{
R
ReadOut, parse a PHREEQC output file}
\name{ReadOut}
\alias{ReadOut}
\title{ReadOut, parse a PHREEQC output file}
\usage{
R
ReadOut(out)
ReadOut(out)
}
\arguments{
\item{out}{The PHREEQC output file.}
...
...
@@ -19,11 +19,11 @@ calculation were made with Rphree.
}
\details{
Currently all blocks are read. For simulations with kinetics the
function to use is \code{\link{
R
ReadOutKin}}.
function to use is \code{\link{ReadOutKin}}.
}
\examples{
\dontrun{
out <-
R
ReadOut("ex.out")
out <- ReadOut("ex.out")
}
}
\author{
...
...
man/
R
ReadOutKin.Rd
→
man/ReadOutKin.Rd
View file @
2a58aebd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Rphree_Files.R
\name{
R
ReadOutKin}
\alias{
R
ReadOutKin}
\title{
R
ReadOutKin, imports the output file of a kinetic
\name{ReadOutKin}
\alias{ReadOutKin}
\title{ReadOutKin, imports the output file of a kinetic
simulation into R}
\usage{
R
ReadOutKin(out, verbose = FALSE)
ReadOutKin(out, verbose = FALSE)
}
\arguments{
\item{out}{The PHREEQC output file or buffer}
...
...
man/
R
ReadOutVal.Rd
→
man/ReadOutVal.Rd
View file @
2a58aebd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Rphree_Files.R
\name{
R
ReadOutVal}
\alias{
R
ReadOutVal}
\title{
R
ReadOutVal, parse a PHREEQC output file/buffer in search
\name{ReadOutVal}
\alias{ReadOutVal}
\title{ReadOutVal, parse a PHREEQC output file/buffer in search
of specific valence state of an element}
\usage{
R
ReadOutVal(out, valence)
ReadOutVal(out, valence)
}
\arguments{
\item{out}{The PHREEQC output file or buffer}
...
...
man/StoichiometricMatrix.Rd
View file @
2a58aebd
...
...
@@ -10,7 +10,7 @@ StoichiometricMatrix(flatlist, db, species, pphases)
\arguments{
\item{flatlist}{a flatted list of Rphree simulations}
\item{db}{database (as read by
R
ReadFile(..., is.db=TRUE))}
\item{db}{database (as read by ReadFile(..., is.db=TRUE))}
\item{species}{vector containing all species to be included in the
stoichiometric matrix. If omitted, the flat list is searched
...
...
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