# This example attempts to run a input string, fails and writes
# the error message to the error file (no database is loaded).
phrSetErrorFileOn(TRUE)
phrSetErrorFileName(file.path(tempdir(), "phreeqc.errors"))
input <- c(
'SOLUTION 1 Pure water ',
'EQUILIBRIUM_PHASES 1 ',
' Calcite 0 10 '
)
if (is.null(phrRunString(input))) {
cat(paste("see ", phrGetErrorFileName(), ".\n", sep = ""))
}
Run the code above in your browser using DataLab