Commit 7673975e authored by Marco De Lucia's avatar Marco De Lucia
Browse files

MDL: some fixes for CRAN submission

parent 199bd108
Package: RedModRphree Package: RedModRphree
Title: Programmable interface to the phreeqc geochemical solver adding features such as surrogate models, reactive transport and Pourbaix diagrams Title: Programmable Interface to the PHREEQC Geochemical Solver
Version: 0.2 Version: 0.3.1
Authors@R: c(person("Marco", "De Lucia", email = "delucia@gfz-potsdam.de", role = c("aut", "cre"), comment=, comment = c(ORCID = "0000-0003-0918-3766")), Authors@R: c(person(given = "Marco",
person("Janis", "Jatnieks", email = "deltaxzz@gmail.com", role = c("ctb"))) family = "De Lucia",
Author: Marco De Lucia [aut, cre], email = "delucia@gfz-potsdam.de",
Janis Jatnieks [ctb] role = c("aut", "cre"),
Maintainer: Marco De Lucia <delucia@gfz-potsdam.de> comment = c(ORCID = "0000-0003-0918-3766")),
Description: Programmable interface to the phreeqc geochemical solver adding features such as surrogate models, reactive transport and Pourbaix diagrams. person(given = "Janis",
family = "Jatnieks",
email = "deltaxzz@gmail.com",
role = c("ctb")))
Description: Programmable interface to the phreeqc geochemical solver
adding features such as surrogate models, reactive transport and
Pourbaix diagrams.
Depends: R (>= 3.2.0), doParallel, phreeqc, mgcv, graphics, methods, stats, utils, plyr, foreach Depends: R (>= 3.2.0), doParallel, phreeqc, mgcv, graphics, methods, stats, utils, plyr, foreach
License: LGPL-2.1 License: LGPL-2.1
Encoding: UTF-8 Encoding: UTF-8
LLazyData: true
RoxygenNote: 7.1.1 RoxygenNote: 7.1.1
LazyData: true
...@@ -11,7 +11,6 @@ export(DistributeKin) ...@@ -11,7 +11,6 @@ export(DistributeKin)
export(DistributeKinMatrix) export(DistributeKinMatrix)
export(DistributeMatrix) export(DistributeMatrix)
export(ElementalBalanceMin) export(ElementalBalanceMin)
export(ExtractPphases)
export(ExtractSamples) export(ExtractSamples)
export(ExtractSpecies) export(ExtractSpecies)
export(ExtractTotals) export(ExtractTotals)
......
## Functions for dealing with simulations with kinetics ## Functions for dealing with simulations with kinetics
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021 ### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-04-12 12:46:35 delucia" ### Time-stamp: "Last modified 2021-04-28 15:19:27 delucia"
##' This function runs the generated input buffer (or a list thereof) ##' This function runs the generated input buffer (or a list thereof)
##' through \code{phreeqc}, which has been already loaded as ##' through \code{phreeqc}, which has been already loaded as
##' dependency. Also the database must be previously and explicitely ##' dependency. Also the database must be previously and explicitely
##' loaded by the user using, e.g., ##' loaded by the user using, e.g., \code{db <-
##' \code{db <- RPhreeFile('/path/to/database.dat', is.db=TRUE)} ##' RPhreeFile('/path/to/database.dat', is.db=TRUE)} followed by
##' followed by ##' \code{phreeqc::phrLoadDatabaseString(db)} or using one of the
##' \code{phreeqc::phrLoadDatabaseString(db)} ##' databases included in \code{phreeqc}, e.g.,
##' or using one of the databases included in \code{phreeqc}, e.g.,
##' \code{phreeqc::phrLoadDatabaseString(phreeqc.dat)}. ##' \code{phreeqc::phrLoadDatabaseString(phreeqc.dat)}.
##' ##'
##' Parallelization is achieved using \code{%dopar%} from package ##' Parallelization is achieved using \code{%dopar%} from package
...@@ -55,7 +54,6 @@ RunPQC <- function(input, procs=1, second=TRUE) { ...@@ -55,7 +54,6 @@ RunPQC <- function(input, procs=1, second=TRUE) {
## old one ## old one
## res <- parallel::mclapply(input, .runPQC, mc.silent=TRUE, mc.cores=procs) ## res <- parallel::mclapply(input, .runPQC, mc.silent=TRUE, mc.cores=procs)
## res <- parallel::parLapply(ThisRunCluster, input, .runPQC)
res <- foreach::foreach(i=seq_along(input), .combine=rbind) %dopar% .runPQC(input[[i]], onlysecond=second) res <- foreach::foreach(i=seq_along(input), .combine=rbind) %dopar% .runPQC(input[[i]], onlysecond=second)
## ## a is the string containing the rbind of each element of the list ## ## a is the string containing the rbind of each element of the list
...@@ -79,7 +77,8 @@ RunPQC <- function(input, procs=1, second=TRUE) { ...@@ -79,7 +77,8 @@ RunPQC <- function(input, procs=1, second=TRUE) {
##' @param prop The property whose values need to be distributed. ##' @param prop The property whose values need to be distributed.
##' @param values The numerical value(s) to distribute across the ##' @param values The numerical value(s) to distribute across the
##' SOLUTIONS/KINETICS blocks. ##' SOLUTIONS/KINETICS blocks.
##' @param ident The identifier for the line where the actual values will be pasted, defaults to "-m" ##' @param ident The identifier for the line where the actual values
##' will be pasted, defaults to "-m"
##' @return A new input buffer ##' @return A new input buffer
##' @author MDL ##' @author MDL
##' @export ##' @export
......
## Functions for dealing with surrogate simulations ## Functions for dealing with surrogate simulations
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2018 ### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-04-12 13:05:02 delucia" ### Time-stamp: "Last modified 2021-04-28 15:30:47 delucia"
##' Todo ##' Todo
...@@ -203,17 +203,22 @@ ReduceState <- function(data) ...@@ -203,17 +203,22 @@ ReduceState <- function(data)
##' occurences of a geochemical problem? ##' occurences of a geochemical problem?
##' @param ebreak logical, defaults to FALSE. If TRUE, an early break ##' @param ebreak logical, defaults to FALSE. If TRUE, an early break
##' is invoked ##' is invoked
##' @param writeout logical, defaults to FALSE. ##' @param writeout logical, defaults to FALSE. Should we write the
##' phreeqc output on disk?
##' @param surrogate logical, defaults to FALSE. Should we use ##' @param surrogate logical, defaults to FALSE. Should we use
##' surrogates instead of phreeqc? ##' surrogates instead of phreeqc?
##' @param surrogate.FUN The function which calls the surrogate ##' @param surrogate.FUN The function which calls the surrogate
##' @param model The list of surrogate models, one element per ##' @param model a list containing all surrogate models, one element
##' variable ##' per variable
##' @param baleq data structure containing the balance equations ##' @param baleq data structure containing the balance equations
##' @param tol absolute tolerance on the mass balance ##' @param tol absolute tolerance on the mass balance. If this is
##' trespassed, phreeqc is called instead
##' @param call_pqc logical, defaults to TRUE: if TRUE, calls phreeqc ##' @param call_pqc logical, defaults to TRUE: if TRUE, calls phreeqc
##' on the surrogate simulations which trespass the tolerance ##' on the surrogate simulations which trespass the tolerance
##' @return a list containing lots of stuff ##' @return a list containing lots of stuff. Each element of the list
##' represent an iteration and has two elements: $T
##' (concentrations after the transport) and $C, concentrations
##' after the chemistry
##' @author MDL ##' @author MDL
##' @export ##' @export
ReactTranspBalanceEq <- function(setup, init, maxtime, step=c("time","iter","fix_dt"), ReactTranspBalanceEq <- function(setup, init, maxtime, step=c("time","iter","fix_dt"),
...@@ -243,9 +248,9 @@ ReactTranspBalanceEq <- function(setup, init, maxtime, step=c("time","iter","fix ...@@ -243,9 +248,9 @@ ReactTranspBalanceEq <- function(setup, init, maxtime, step=c("time","iter","fix
if (procs > 1) { if (procs > 1) {
if (Sys.info()[["sysname"]]=="Windows") { if (Sys.info()[["sysname"]]=="Windows") {
ThisRunCluster <<- parallel::makePSOCKcluster(procs) ThisRunCluster <- parallel::makePSOCKcluster(procs)
} else { } else {
ThisRunCluster <<- parallel::makeForkCluster(procs) ThisRunCluster <- parallel::makeForkCluster(procs)
} }
doParallel::registerDoParallel(ThisRunCluster) doParallel::registerDoParallel(ThisRunCluster)
...@@ -480,7 +485,7 @@ ReactTranspBalanceEq <- function(setup, init, maxtime, step=c("time","iter","fix ...@@ -480,7 +485,7 @@ ReactTranspBalanceEq <- function(setup, init, maxtime, step=c("time","iter","fix
on.exit() on.exit()
if (procs > 1) { if (procs > 1) {
stopCluster(ThisRunCluster) parallel::stopCluster(ThisRunCluster)
msg("Parallelization cluster stopped") msg("Parallelization cluster stopped")
} }
...@@ -553,9 +558,9 @@ ReactTranspBalanceKin <- function(setup, init, maxtime, step=c("time","iter","fi ...@@ -553,9 +558,9 @@ ReactTranspBalanceKin <- function(setup, init, maxtime, step=c("time","iter","fi
if (procs > 1) { if (procs > 1) {
if (Sys.info()[["sysname"]]=="Windows") { if (Sys.info()[["sysname"]]=="Windows") {
ThisRunCluster <<- parallel::makePSOCKcluster(procs) ThisRunCluster <- parallel::makePSOCKcluster(procs)
} else { } else {
ThisRunCluster <<- parallel::makeForkCluster(procs) ThisRunCluster <- parallel::makeForkCluster(procs)
} }
doParallel::registerDoParallel(ThisRunCluster) doParallel::registerDoParallel(ThisRunCluster)
...@@ -791,7 +796,7 @@ ReactTranspBalanceKin <- function(setup, init, maxtime, step=c("time","iter","fi ...@@ -791,7 +796,7 @@ ReactTranspBalanceKin <- function(setup, init, maxtime, step=c("time","iter","fi
on.exit() on.exit()
if (procs > 1) { if (procs > 1) {
stopCluster(ThisRunCluster) parallel::stopCluster(ThisRunCluster)
msg("Parallelization cluster stopped") msg("Parallelization cluster stopped")
} }
......
## Functions for dealing with surrogate simulations ## Functions for dealing with surrogate simulations
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021 ### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-04-12 11:45:32 delucia" ### Time-stamp: "Last modified 2021-04-28 15:32:05 delucia"
##' Computes the average of absolute values of a vector ##' Computes the average of absolute values of a vector
##' @title Average of absolute values ##' @title Average of absolute values
...@@ -90,13 +90,14 @@ ExtractSpecies <- function(flatlist, species) { ...@@ -90,13 +90,14 @@ ExtractSpecies <- function(flatlist, species) {
return(tmp) return(tmp)
} }
##' @title Extract all phases from a flatted Rphree list ##' @title Extract all equilibrium phases from a flattened output list
##' @param flatlist the list as input to search in ##' @param flatlist the list as input to search in
##' @param totals vector containing the names of the phases to search ##' @param pphases character vector containing the names of the Pure
##' for ##' Phases whose values are to be extracted
##' @return matix with one pphases per column ##' @param species vector containing the names of the species to
##' search for
##' @return a matrix containing as many columns as specified pphases
##' @author MDL ##' @author MDL
##' @export
ExtractPphases <- function(flatlist, pphases) { ExtractPphases <- function(flatlist, pphases) {
tmp <- matrix(NA, len <- length(flatlist), speclen <- length(pphases)) tmp <- matrix(NA, len <- length(flatlist), speclen <- length(pphases))
colnames(tmp) <- pphases colnames(tmp) <- pphases
......
### Utility functions for RedModRphree ### Utility functions for RedModRphree
### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2018 ### Marco De Lucia, delucia@gfz-potsdam.de, 2009-2021
### Time-stamp: "Last modified 2021-04-12 12:58:36 delucia" ### Time-stamp: "Last modified 2021-04-28 14:50:36 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
##' block (e.g: PUNCH) under the first SOLUTION. ##' block (e.g: PUNCH) just once under the first SOLUTION.
##' ##'
##' Analogous to standard \code{rep} function. ##' Analogous to standard \code{rep} function.
##' @title Replicate a SOLUTION ##' @title Replicate a SOLUTION
##' @param sol The initial phreeqc buffer that needs to be replicated. ##' @param sol The initial phreeqc buffer that needs to be replicated
##' @param n Number of replicates to generate. ##' @param n Number of replicates to generate
##' @param first A new block which needs to be inserted only in the ##' @param first A new block which needs to be inserted only in the
##' first solution (typically, PUNCH and alike). ##' first solution (typically, PUNCH and alike)
##' @return A buffer upon which Rphree can be called. ##' @return A buffer upon which RunPQC can be called
##' @author MDL ##' @author MDL
##' @export ##' @export
RepSol <- function(sol, n, first=NULL) RepSol <- function(sol, n, first=NULL)
...@@ -62,8 +62,6 @@ RepSol <- function(sol, n, first=NULL) ...@@ -62,8 +62,6 @@ RepSol <- function(sol, n, first=NULL)
##' Function that adds a new property (species, pure phase, ...) to an ##' Function that adds a new property (species, pure phase, ...) to an
##' input buffer. ##' input buffer.
##'
##' .. content for DETAILS ..
##' @title Add a new property (species, pure phase, ...) to an input ##' @title Add a new property (species, pure phase, ...) to an input
##' buffer ##' buffer
##' @param input The input buffer. ##' @param input The input buffer.
...@@ -72,14 +70,13 @@ RepSol <- function(sol, n, first=NULL) ...@@ -72,14 +70,13 @@ RepSol <- function(sol, n, first=NULL)
##' @param values The value(s) of the property. ##' @param values The value(s) of the property.
##' @param cat The category of the property. Must be one of ##' @param cat The category of the property. Must be one of
##' \code{c("tot","pphases","kin")} ##' \code{c("tot","pphases","kin")}
##' @param kinpar Kinetics parameters for the KINETICS case. ##' @param kinpar Kinetics parameters for the KINETICS case
##' @param first A block to be added in the first SOLUTION, as in ##' @param first A block to be added in the first SOLUTION, as in
##' \code{RepSol} and \code{Distribute}. ##' \code{RepSol} and \code{Distribute}
##' @return The new input buffer upon which Rphree can be called. ##' @return The new input buffer upon which RunPQC can be called
##' @author MDL ##' @author MDL
##' @export ##' @export
AddProp <- function(input, name, values, cat, kinpar=NULL, first=NULL) AddProp <- function(input, name, values, cat, kinpar=NULL, first=NULL)
### Add a property (species, pure phase, ...) to an input buffer
{ {
cat <- match.arg(cat,c("tot","pphases","kin")) cat <- match.arg(cat,c("tot","pphases","kin"))
...@@ -150,16 +147,18 @@ AddProp <- function(input, name, values, cat, kinpar=NULL, first=NULL) ...@@ -150,16 +147,18 @@ AddProp <- function(input, name, values, cat, kinpar=NULL, first=NULL)
##' replicated length(values) times by RepSol. For KINETICS use ##' replicated length(values) times by RepSol. For KINETICS use
##' \code{DistributeKin}. ##' \code{DistributeKin}.
##' ##'
##' @title Distribute properties in an input buffer. ##' @title Distribute properties in an input buffer
##' @param input The initial input buffer. ##' @param input The initial input buffer
##' @param prop The property whose values need to be distributed. ##' @param prop The property whose values need to be distributed
##' @param values The numerical value(s) to distribute across the SOLUTIONS. ##' @param values The numerical value(s) to distribute across the
##' SOLUTIONS
##' @param newname Optional name of a property which is not initially ##' @param newname Optional name of a property which is not initially
##' present in the input buffer. ##' present in the input buffer
##' @param first The \code{first} block which will be passed to ##' @param first The \code{first} block which will be passed to
##' \code{\link{RepSol}} if needed ##' \code{\link{RepSol}} if needed
##' @param wholeline logical. if TRUE, comments after the properties (i.e. "as HCO3") get also distributed. ##' @param wholeline logical. if TRUE, comments after the properties
##' @return A new input buffer upon which Rphree can be run. ##' (i.e. "as HCO3") get also distributed.
##' @return A new input buffer upon which RunPQC can be run
##' @author MDL ##' @author MDL
##' @export ##' @export
Distribute <- function(input, prop, values, newname=NULL, first=NULL, wholeline=TRUE) Distribute <- function(input, prop, values, newname=NULL, first=NULL, wholeline=TRUE)
...@@ -203,7 +202,6 @@ Distribute <- function(input, prop, values, newname=NULL, first=NULL, wholeline= ...@@ -203,7 +202,6 @@ Distribute <- function(input, prop, values, newname=NULL, first=NULL, wholeline=
##' Erases the SOLUTION number n (label, not position) from an input ##' Erases the SOLUTION number n (label, not position) from an input
##' buffer containing many. ##' buffer containing many.
##'
##' @title Suppress a simulation from an input buffer ##' @title Suppress a simulation from an input buffer
##' @param biginp The input buffer ##' @param biginp The input buffer
##' @param n The number of the simulation to erase ##' @param n The number of the simulation to erase
...@@ -218,22 +216,22 @@ SuppressSim <- function(biginp, n=1L) ...@@ -218,22 +216,22 @@ SuppressSim <- function(biginp, n=1L)
} }
##' This functions extracts informations from calculated Rphree ##' This functions extracts informations extracted from standard
##' formatted solutions. ##' PHREEQC output files
##' ##' @title Extract specific values from a phreeqc output
##' @title Extract specific values from an Rphree output ##' @param lin The list containg the parsed phreeqc solution(s)
##' @param lin The list containg the Rphree solution(s)
##' @param cat A string indicating the category (or output block) to ##' @param cat A string indicating the category (or output block) to
##' search in, must be one of: "tot, desc, pphases, master, species, ##' search in, must be one of:
##' kin, SI" ##' "tot, desc, pphases, master, species, kin, SI"
##' @param prop The name of the inquired property (element, species, ##' @param prop The name of the inquired property (element, species,
##' mineral phase,\dots) whose value(s) ##' mineral phase,\dots) whose value(s)
##' @param force Logical. If TRUE (default if left unspecified), a valid numeric value (0) is returned even if the property is not found ##' @param force Logical. If TRUE (default if left unspecified), a
##' value is returned if the inquired property is not found in the ##' valid numeric value (0) is returned even if the property is
##' solution ##' not found value is returned if the inquired property is not
##' found in the solution
##' @param flex Logical. If TRUE, expects no "ListInfo" in the ##' @param flex Logical. If TRUE, expects no "ListInfo" in the
##' formatted solution list and performs heuristics to circumvent this ##' formatted solution list and performs heuristics to circumvent
##' absence ##' this absence
##' @return A numeric vector containing the inquired properties ##' @return A numeric vector containing the inquired properties
##' @author MDL ##' @author MDL
##' @examples ##' @examples
...@@ -290,7 +288,6 @@ RPinfo <- function(lin, cat=c("tot","desc","pphases","master","species","kin","S ...@@ -290,7 +288,6 @@ RPinfo <- function(lin, cat=c("tot","desc","pphases","master","species","kin","S
##' Workhorse function for extraction of results from a solution, ##' Workhorse function for extraction of results from a solution,
##' primarily intended to be used by \code{\link{RPinfo}}, where it is ##' primarily intended to be used by \code{\link{RPinfo}}, where it is
##' called inside a \code{sapply} statement. ##' called inside a \code{sapply} statement.
##'
##' @title Workhorse function for extraction of informations from a ##' @title Workhorse function for extraction of informations from a
##' solution ##' solution
##' @param sol The solution outputted by Rphree ##' @param sol The solution outputted by Rphree
...@@ -311,7 +308,8 @@ RPhreeExt <- function(sol, cat, prop) ...@@ -311,7 +308,8 @@ RPhreeExt <- function(sol, cat, prop)
##' Workhorse function for extraction of results from a solution, ##' Workhorse function for extraction of results from a solution,
##' specifically equilibrium phases. ##' specifically equilibrium phases.
##' ##'
##' @title Workhorse function for extraction of ##' @title Workhorse function for extraction of equilibrium phases
##' from a solution list
##' @param lin The solution outputted by Rphree ##' @param lin The solution outputted by Rphree
##' @param which String containing the name of the specific pphase to ##' @param which String containing the name of the specific pphase to
##' look for. If omitted, all pphases are returned. ##' look for. If omitted, all pphases are returned.
...@@ -336,10 +334,10 @@ RGetPhases <- function(lin, which=NULL, delta=TRUE) ...@@ -336,10 +334,10 @@ RGetPhases <- function(lin, which=NULL, delta=TRUE)
##' Workhorse function for extraction of results from a solution, ##' Workhorse function for extraction of results from a solution,
##' specifically equilibrium phases. Variant. ##' specifically equilibrium phases.
##' ##'
##' @title extract the phases from a Rphree solution ##' @title extract the phases from a PHREEQC output
##' @param lin The solution outputted by Rphree ##' @param lin The solution outputted by phree
##' @return A data.frame containing the results of equilibrium phases ##' @return A data.frame containing the results of equilibrium phases
##' @author MDL ##' @author MDL
##' @export ##' @export
......
### RedModRphree, functions to perform basic visualization ### RedModRphree, functions to perform basic visualization
### Licence: LGPL version 2.1 ### Licence: LGPL version 2.1
### Time-stamp: "Last modified 2018-05-06 19:30:10 delucia" ### Time-stamp: "Last modified 2021-04-28 15:16:50 delucia"
##' @title Display the profiles of some variables along a 1D reactive ##' @title Display the profiles of some variables along a 1D reactive
##' transport simulation ##' transport simulation
...@@ -79,7 +79,7 @@ PlotModsInSample <- function(mod, res, des, sample=seq(1,nrow(res)), column=TRUE ...@@ -79,7 +79,7 @@ PlotModsInSample <- function(mod, res, des, sample=seq(1,nrow(res)), column=TRUE
else else
par(mfrow=c(2,nr)) par(mfrow=c(2,nr))
for (i in seq_along(mod)) { for (i in seq_along(mod)) {
plot(result[,i], predict(mod[[i]], design),"p",pch=3, main=names(mod)[i], plot(result[,i], stats::predict(mod[[i]], design),"p",pch=3, main=names(mod)[i],
xlab="Full physics", ylab="Surrogate", ...) xlab="Full physics", ylab="Surrogate", ...)
abline(0,1,lty="dashed",col="grey") abline(0,1,lty="dashed",col="grey")
} }
......
## Time-stamp: "Last modified 2021-04-12 11:40:11 delucia" ## Time-stamp: "Last modified 2021-04-28 15:14:00 delucia"
##' @title Extracts input/output tables from a list of Reactive ##' @title Extracts input/output tables from a list of Reactive
##' Transport Simulations ##' Transport Simulations
##' @param simlist a list containing the simulations ##' @param simlist a list containing the simulations
......
...@@ -18,21 +18,18 @@ mineral,...)} ...@@ -18,21 +18,18 @@ mineral,...)}
\item{cat}{The category of the property. Must be one of \item{cat}{The category of the property. Must be one of
\code{c("tot","pphases","kin")}} \code{c("tot","pphases","kin")}}
\item{kinpar}{Kinetics parameters for the KINETICS case.} \item{kinpar}{Kinetics parameters for the KINETICS case}
\item{first}{A block to be added in the first SOLUTION, as in \item{first}{A block to be added in the first SOLUTION, as in
\code{RepSol} and \code{Distribute}.} \code{RepSol} and \code{Distribute}}
} }
\value{ \value{
The new input buffer upon which Rphree can be called. The new input buffer upon which RunPQC can be called
} }
\description{ \description{
Function that adds a new property (species, pure phase, ...) to an Function that adds a new property (species, pure phase, ...) to an
input buffer. input buffer.
} }
\details{
.. content for DETAILS ..
}
\author{ \author{
MDL MDL
} }
...@@ -2,27 +2,29 @@ ...@@ -2,27 +2,29 @@
% Please edit documentation in R/Rphree_Utils.R % Please edit documentation in R/Rphree_Utils.R
\name{Distribute} \name{Distribute}
\alias{Distribute} \alias{Distribute}
\title{Distribute properties in an input buffer.} \title{Distribute properties in an input buffer}
\usage{ \usage{
Distribute(input, prop, values, newname = NULL, first = NULL, wholeline = TRUE) Distribute(input, prop, values, newname = NULL, first = NULL, wholeline = TRUE)
} }
\arguments{ \arguments{
\item{input}{The initial input buffer.} \item{input}{The initial input buffer}
\item{prop}{The property whose values need to be distributed.} \item{prop}{The property whose values need to be distributed}
\item{values}{The numerical value(s) to distribute across the SOLUTIONS.} \item{values}{The numerical value(s) to distribute across the
SOLUTIONS}
\item{newname}{Optional name of a property which is not initially \item{newname}{Optional name of a property which is not initially
present in the input buffer.} present in the input buffer}
\item{first}{The \code{first} block which will be passed to \item{first}{The \code{first} block which will be passed to
\code{\link{RepSol}} if needed} \code{\link{RepSol}} if needed}
\item{wholeline}{logical. if TRUE, comments after the properties (i.e. "as HCO3") get also distributed.} \item{wholeline}{logical. if TRUE, comments after the properties
(i.e. "as HCO3") get also distributed.}
} }
\value{ \value{
A new input buffer upon which Rphree can be run. A new input buffer upon which RunPQC can be run
} }
\description{ \description{
Function to distribute different values of one property Function to distribute different values of one property
......
...@@ -14,7 +14,8 @@ DistributeKin(input, prop = NULL, values, ident = "-m0") ...@@ -14,7 +14,8 @@ DistributeKin(input, prop = NULL, values, ident = "-m0")
\item{values}{The numerical value(s) to distribute across the \item{values}{The numerical value(s) to distribute across the
SOLUTIONS/KINETICS blocks.} SOLUTIONS/KINETICS blocks.}
\item{ident}{The identifier for the line where the actual values will be pasted, defaults to "-m"} \item{ident}{The identifier for the line where the actual values
will be pasted, defaults to "-m"}
} }
\value{ \value{
A new input buffer A new input buffer
......
...@@ -2,21 +2,24 @@ ...@@ -2,21 +2,24 @@
% Please edit documentation in R/Rphree_SurrogateUtils.R % Please edit documentation in R/Rphree_SurrogateUtils.R
\name{ExtractPphases} \name{ExtractPphases}
\alias{ExtractPphases} \alias{ExtractPphases}
\title{Extract all phases from a flatted Rphree list} \title{Extract all equilibrium phases from a flattened output list}
\usage{ \usage{
ExtractPphases(flatlist, pphases) ExtractPphases(flatlist, pphases)
} }
\arguments{ \arguments{
\item{flatlist}{the list as input to search in} \item{flatlist}{the list as input to search in}
\item{totals}{vector containing the names of the phases to search \item{pphases}{character vector containing the names of the Pure
for} Phases whose values are to be extracted}
\item{species}{vector containing the names of the species to
search for}
} }
\value{ \value{
matix with one pphases per column a matrix containing as many columns as specified pphases
} }
\description{ \description{
Extract all phases from a flatted Rphree list Extract all equilibrium phases from a flattened output list
} }
\author{ \author{
MDL MDL
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@