[CHNOSZ-commits] r624 - in pkg/CHNOSZ: . demo inst vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 10 14:58:31 CET 2020


Author: jedick
Date: 2020-11-10 14:58:31 +0100 (Tue, 10 Nov 2020)
New Revision: 624

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/demo/AkDi.R
   pkg/CHNOSZ/demo/DEW.R
   pkg/CHNOSZ/demo/Shh.R
   pkg/CHNOSZ/demo/TCA.R
   pkg/CHNOSZ/demo/adenine.R
   pkg/CHNOSZ/demo/affinity.R
   pkg/CHNOSZ/demo/aluminum.R
   pkg/CHNOSZ/demo/glycinate.R
   pkg/CHNOSZ/demo/gold.R
   pkg/CHNOSZ/demo/lambda.R
   pkg/CHNOSZ/demo/solubility.R
   pkg/CHNOSZ/demo/sphalerite.R
   pkg/CHNOSZ/demo/zinc.R
   pkg/CHNOSZ/inst/NEWS.Rd
   pkg/CHNOSZ/vignettes/equilibrium.Rmd
Log:
Improve cleanup of plot parameters and layout in demos


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/DESCRIPTION	2020-11-10 13:58:31 UTC (rev 624)
@@ -1,6 +1,6 @@
 Date: 2020-11-10
 Package: CHNOSZ
-Version: 1.3.6-96
+Version: 1.3.6-97
 Title: Thermodynamic Calculations and Diagrams for Geochemistry
 Authors at R: c(
     person("Jeffrey", "Dick", , "j3ffdick at gmail.com", role = c("aut", "cre"),

Modified: pkg/CHNOSZ/demo/AkDi.R
===================================================================
--- pkg/CHNOSZ/demo/AkDi.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/AkDi.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -24,7 +24,9 @@
 }
 
 # set up plot
+opar <- par(no.readonly = TRUE)
 par(mfrow=c(2, 2))
+
 ylab <- quote(ln~italic(K[H]))
 xlab <- quote(1000 / list(italic(T), K))
 
@@ -79,3 +81,4 @@
 legend("bottomright", c("Data (AD03, Fig. 1d)", "AkDi model", "HKF model"), lty=c(0, 1, 3), pch=c(1, NA, NA), col=c(1, 1, 2), bty="n")
 title(main=syslab(c("CH4", "H2O"), dash = " - "))
 
+par(opar)

Modified: pkg/CHNOSZ/demo/DEW.R
===================================================================
--- pkg/CHNOSZ/demo/DEW.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/DEW.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -2,7 +2,8 @@
 library(CHNOSZ)
 
 # set up subplots
-opar <- par(mfrow = c(2, 2), mar=c(3.0, 3.5, 2.5, 1.0), mgp=c(1.7, 0.3, 0), las=1, tcl=0.3, xaxs="i", yaxs="i")
+opar <- par(no.readonly = TRUE)
+par(mfrow = c(2, 2), mar=c(3.0, 3.5, 2.5, 1.0), mgp=c(1.7, 0.3, 0), las=1, tcl=0.3, xaxs="i", yaxs="i")
 
 # activate DEW model
 oldwat <- water("DEW")
@@ -211,3 +212,5 @@
 
 # reset OBIGT database
 reset()
+
+par(opar)

Modified: pkg/CHNOSZ/demo/Shh.R
===================================================================
--- pkg/CHNOSZ/demo/Shh.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/Shh.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -50,6 +50,7 @@
 xlab <- expression(log*italic(a)[H[2]][O])
 # set up normal plot, or plot with interpretive drawings
 opar <- par(no.readonly = TRUE)
+par(mar = c(5.1, 4.1, 4.1, 2.1))
 if(interp) {
   if(pdf) pdf("tfactor_interp.pdf", width=6, height=6)
   plot.new()

Modified: pkg/CHNOSZ/demo/TCA.R
===================================================================
--- pkg/CHNOSZ/demo/TCA.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/TCA.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -68,7 +68,8 @@
     substitute(3*co2 + 4*nred + 2*hplus + atp + h2 * "           ", sublist))
 )
 # set up plot
-opar <- par(mfrow=c(3, 3))
+opar <- par(no.readonly = TRUE)
+par(mfrow=c(3, 3))
 ylims <- list(
   c(-10, 45), c(1, 6),   c(-2.5, 7.5),
   c(-35, 5),  c(-9, 5),  c(5, 28),

Modified: pkg/CHNOSZ/demo/adenine.R
===================================================================
--- pkg/CHNOSZ/demo/adenine.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/adenine.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -119,4 +119,5 @@
 # reset database and computational settings
 reset()
 
+layout(matrix(1))
 par(opar)

Modified: pkg/CHNOSZ/demo/affinity.R
===================================================================
--- pkg/CHNOSZ/demo/affinity.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/affinity.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -25,8 +25,10 @@
     legend=describe.property("T", T, digits=0, ret.val=TRUE) )
 }
 # plot layout with space for title at top
+opar <- par(no.readonly = TRUE)
 layout(matrix(c(1, 1, 2, 3, 4, 5), ncol=2, byrow=TRUE), heights=c(1, 4, 4))
-opar <- par(mar=c(0, 0, 0, 0))
+
+par(mar=c(0, 0, 0, 0))
 plot.new()
 # we use subcrt() to generate a reaction for titling the plot
 rxnexpr <- describe.reaction(subcrt("H2O", 1)$reaction, states="all")
@@ -42,6 +44,7 @@
 print(affinity(H2=c(-10, 0, 3), O2=c(-10, 0, 3), T=c(25, 150, 4))$values)
 # this is so the plots in the next examples show up OK
 E.units("cal")
+
 layout(matrix(1))
 par(opar)
 

Modified: pkg/CHNOSZ/demo/aluminum.R
===================================================================
--- pkg/CHNOSZ/demo/aluminum.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/aluminum.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -4,7 +4,8 @@
 library(CHNOSZ)
 
 ## set up plotting area
-opar <- par(mfrow = c(2, 2))
+opar <- par(no.readonly = TRUE)
+par(mfrow = c(2, 2))
 
 ###########
 ### plot 1: boehmite - kaolinite equilibrium

Modified: pkg/CHNOSZ/demo/glycinate.R
===================================================================
--- pkg/CHNOSZ/demo/glycinate.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/glycinate.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -45,12 +45,11 @@
 matplot(T, sapply(logK_di1, c), type = "l", lwd = 2, lty = 1, xlab = xlab, ylab = ylab)
 matplot(T, sapply(logK_di1_SK95, c), type = "l", lwd = 2, lty = 2, add = TRUE)
 legend(-9, 7.7, c("Azadi et al., 2019", "Shock and Koretsky, 1995"), lty = c(1, 2), bty = "n", cex = 1)
-# \u21cc is the double reaction arrow
-mtext(expression(M^"+2" + Gly^"-"~"\u21cc"~M*(Gly)^"+"), line = 0.5)
+mtext(expression(M^"+2" + Gly^"-" == M*(Gly)^"+"), line = 0.5)
 matplot(T, sapply(logK_di2, c), type = "l", lwd = 2, lty = 1, xlab = xlab, ylab = ylab)
 matplot(T, sapply(logK_di2_SK95, c), type = "l", lwd = 2, lty = 2, add = TRUE)
 legend(-9, 14, c("Azadi et al., 2019", "Shock and Koretsky, 1995"), lty = c(1, 2), bty = "n", cex = 1)
-mtext(expression(M^"+2" + 2*Gly^"-"~"\u21cc"~M*(Gly)[2]), line = 0.5)
+mtext(expression(M^"+2" + 2*Gly^"-" == M*(Gly)[2]), line = 0.5)
 plot.new()
 par(xpd = NA)
 legend("right", as.expression(lapply(di, expr.species)), lty = 1, col = 1:6, bty = "n", cex = 1.2, lwd = 2)
@@ -61,11 +60,13 @@
 
 # second row: monovalent metals
 matplot(T, sapply(logK_mo1, c), type = "l", lwd = 2, lty = 1, xlab = xlab, ylab = ylab)
-mtext(expression(M^"+" + Gly^"-"~"\u21cc"~M*(Gly)), line = 0.5)
+mtext(expression(M^"+" + Gly^"-" == M*(Gly)), line = 0.5)
 matplot(T, sapply(logK_mo2, c), type = "l", lwd = 2, lty = 1, xlab = xlab, ylab = ylab)
-mtext(expression(M^"+" + 2*Gly^"-"~"\u21cc"~M*(Gly)[2]^"-"), line = 0.5)
+mtext(expression(M^"+" + 2*Gly^"-" == M*(Gly)[2]^"-"), line = 0.5)
 plot.new()
 par(xpd = NA)
 legend("right", as.expression(lapply(mo, expr.species)), lty = 1, col = 1:5, bty = "n", cex = 1.2, lwd = 2)
 par(xpd = FALSE)
+
+layout(matrix(1))
 par(opar)

Modified: pkg/CHNOSZ/demo/gold.R
===================================================================
--- pkg/CHNOSZ/demo/gold.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/gold.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -174,7 +174,8 @@
 }
 
 # make plots
-opar <- par(mfrow = c(2, 2))
+opar <- par(no.readonly = TRUE)
+par(mfrow = c(2, 2))
 Au_pH1()
 Au_pH2()
 Au_T1()

Modified: pkg/CHNOSZ/demo/lambda.R
===================================================================
--- pkg/CHNOSZ/demo/lambda.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/lambda.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -87,4 +87,6 @@
 labplot("f")
 
 reset()
+
+layout(matrix(1))
 par(opar)

Modified: pkg/CHNOSZ/demo/solubility.R
===================================================================
--- pkg/CHNOSZ/demo/solubility.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/solubility.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -70,4 +70,5 @@
 diagram(s, type = "loga.balance")
 title(main = "Solubility of calcite", font.main = 1)
 
+layout(matrix(1))
 par(opar)

Modified: pkg/CHNOSZ/demo/sphalerite.R
===================================================================
--- pkg/CHNOSZ/demo/sphalerite.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/sphalerite.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -2,6 +2,7 @@
 # sphalerite solubility after Akinfiev and Tagirov, 2014, Fig. 13
 # 20190526 jmd initial version
 library(CHNOSZ)
+opar <- par(no.readonly = TRUE)
 
 # set up chemical system
 basis(c("ZnS", "Cl-", "H2S", "H2O", "O2", "H+"))
@@ -36,6 +37,8 @@
 plotfun()
 title(main = ("Solubility of sphalerite, after Akinfiev and Tagirov, 2014, Fig. 13"), font.main = 1)
 
+par(opar)
+
 ### the following code for making multiple plots is not used in the demo ###
 
 # a function to make a page of plots

Modified: pkg/CHNOSZ/demo/zinc.R
===================================================================
--- pkg/CHNOSZ/demo/zinc.R	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/demo/zinc.R	2020-11-10 13:58:31 UTC (rev 624)
@@ -5,6 +5,7 @@
 # 20201014 added to CHNOSZ
 
 library(CHNOSZ)
+opar <- par(no.readonly = TRUE)
 par(mfrow = c(2, 2))
 
 # system variables
@@ -99,3 +100,4 @@
 title(bquote(log[10]~"moles of Zn in solution"), line = 0.7)
 label.figure("C")
 
+par(opar)

Modified: pkg/CHNOSZ/inst/NEWS.Rd
===================================================================
--- pkg/CHNOSZ/inst/NEWS.Rd	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/inst/NEWS.Rd	2020-11-10 13:58:31 UTC (rev 624)
@@ -36,8 +36,8 @@
 
       \item The all-uppercase acronym \strong{OBIGT} is used everywhere it
       appears in file, function, and object names. In particular, the
-      thermodynamic database now sits at \code{thermo()$OBIGT}, and functions
-      \code{add.OBIGT()} and \code{mod.OBIGT()} replace the previous
+      thermodynamic database now is located at \code{thermo()$OBIGT}, and
+      functions \code{add.OBIGT()} and \code{mod.OBIGT()} replace the previous
       \code{add.obigt()} and \code{mod.obigt()}.
 
       \item The new default of \code{NULL} for \strong{limit.water} in
@@ -246,8 +246,8 @@
       method from \href{https://doi.org/10.1063/1.1744264}{White et al., 1958})
       and demo \code{wjd.R} and supporting data file.
 
-      \item Add "QCa" as a keyword for preset species in basis() (glutamine,
-        cysteine, acetic acid, \H2O, O\s{2}).
+      \item Add "QCa" as a keyword for preset species in \code{basis()}
+      (glutamine, cysteine, acetic acid, \H2O, O\s{2}).
 
       \item Add \strong{T} and \strong{P} arguments to \code{retrieve()} to
       require that species have non-NA values of standard Gibbs energy at this

Modified: pkg/CHNOSZ/vignettes/equilibrium.Rmd
===================================================================
--- pkg/CHNOSZ/vignettes/equilibrium.Rmd	2020-11-10 12:18:19 UTC (rev 623)
+++ pkg/CHNOSZ/vignettes/equilibrium.Rmd	2020-11-10 13:58:31 UTC (rev 624)
@@ -133,7 +133,7 @@
 
 ## Example 1: Amino acids
 
-In this sytem the basis species are CO2, H~2~O, NH~3~, H~2~S, and O~2~ and the formed species are 20 amino acids.
+In this sytem the basis species are CO~2~, H~2~O, NH~3~, H~2~S, and O~2~ and the formed species are 20 amino acids.
 
 ```{r AAsetup, results = "hide", message = FALSE}
 library(CHNOSZ)



More information about the CHNOSZ-commits mailing list