# This example runs ex2 with the output file turned on.
# write temporary input file
tf <- tempfile()
writeLines(ex2, tf)
# load database and run input file
phrLoadDatabaseString(phreeqc.dat)
phrSetOutputFileOn(TRUE)
phrSetOutputFileName(file.path(tempdir(), "ex2.out"))
if (is.null(phrRunFile(tf))) {
cat(paste("see ", phrGetOutputFileName(), ".\n", sep = ""))
}
# delete temporary input file
unlink(tf)
Run the code above in your browser using DataLab