#
# This example accumulates phreeqc input into a character vector
# and runs it.
#
# load phreeqc.dat file
phrLoadDatabaseString(phreeqc.dat)
# create input
input <- vector()
input <- c(input, "SOLUTION 1")
input <- c(input, " temp 25.0")
input <- c(input, " pH 7.0")
# turn on output
phrSetOutputFileOn(TRUE)
phrSetOutputFileName(file.path(tempdir(), "pure_water.out"))
# run input
phrRunString(input)
cat(paste("see ", phrGetOutputFileName(), ".\n", sep=""))
Run the code above in your browser using DataLab