Commit 2a58aebd authored by Marco De Lucia's avatar Marco De Lucia
Browse files

Renamed RReadOut* to ReadOut

parent 05d337ff
......@@ -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)
......
### File-related utility functions for RedModRphree
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-04-29 18:02:02 delucia"
### Time-stamp: "Last modified 2021-06-27 16: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{RReadOutKin}}.
##' @title RReadOut, 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 <- RReadOut("ex.out")
##' out <- ReadOut("ex.out")
##' }
RReadOut <- 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 RReadOutKin, 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
RReadOutKin <- 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 RReadOutVal, 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
RReadOutVal <- function(out, valence)
ReadOutVal <- function(out, valence)
{
if (length(out)==1) {## is it a buffer or a file?
## note that empty lines are removed!
......
### Licence: LGPL version 2.1
## Time-stamp: "Last modified 2021-04-29 15:56:47 delucia"
## Time-stamp: "Last modified 2021-06-27 16: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 <- RReadOutVal(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 <- RReadOutVal(con, valence)[[1]])
utils::capture.output(res <- ReadOutVal(con, valence)[[1]])
selout <- FormSelectedOutput(res, element)
} else {
utils::capture.output(res <- RReadOutVal(con)[[1]])
utils::capture.output(res <- ReadOutVal(con)[[1]])
selout <- FormSelectedOutput(res, element)
}
}
......
## Functions for dealing with surrogate simulations
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-04-29 18:05:53 delucia"
### Time-stamp: "Last modified 2021-06-27 16:17:52 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 RReadFile(..., 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
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Rphree_Files.R
\name{RReadOut}
\alias{RReadOut}
\title{RReadOut, parse a PHREEQC output file}
\name{ReadOut}
\alias{ReadOut}
\title{ReadOut, parse a PHREEQC output file}
\usage{
RReadOut(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{RReadOutKin}}.
function to use is \code{\link{ReadOutKin}}.
}
\examples{
\dontrun{
out <- RReadOut("ex.out")
out <- ReadOut("ex.out")
}
}
\author{
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Rphree_Files.R
\name{RReadOutKin}
\alias{RReadOutKin}
\title{RReadOutKin, imports the output file of a kinetic
\name{ReadOutKin}
\alias{ReadOutKin}
\title{ReadOutKin, imports the output file of a kinetic
simulation into R}
\usage{
RReadOutKin(out, verbose = FALSE)
ReadOutKin(out, verbose = FALSE)
}
\arguments{
\item{out}{The PHREEQC output file or buffer}
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Rphree_Files.R
\name{RReadOutVal}
\alias{RReadOutVal}
\title{RReadOutVal, 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{
RReadOutVal(out, valence)
ReadOutVal(out, valence)
}
\arguments{
\item{out}{The PHREEQC output file or buffer}
......
......@@ -10,7 +10,7 @@ StoichiometricMatrix(flatlist, db, species, pphases)
\arguments{
\item{flatlist}{a flatted list of Rphree simulations}
\item{db}{database (as read by RReadFile(..., 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
......
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