# create temporary database file
tf <- tempfile()
writeLines(phreeqc.dat, tf)
if (is.null(phrLoadDatabase(tf))) {
cat("database ok\n")
} else {
cat("database contains errors\n")
}
# delete temporary database file
unlink(tf)
Run the code above in your browser using DataLab