[CHNOSZ-commits] r765 - in pkg/CHNOSZ: . R demo inst man vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 15 13:50:13 CET 2023


Author: jedick
Date: 2023-02-15 13:50:13 +0100 (Wed, 15 Feb 2023)
New Revision: 765

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/util.expression.R
   pkg/CHNOSZ/demo/buffer.R
   pkg/CHNOSZ/demo/comproportionation.R
   pkg/CHNOSZ/demo/gold.R
   pkg/CHNOSZ/demo/protbuff.R
   pkg/CHNOSZ/demo/saturation.R
   pkg/CHNOSZ/inst/NEWS.Rd
   pkg/CHNOSZ/man/diagram.Rd
   pkg/CHNOSZ/man/mix.Rd
   pkg/CHNOSZ/man/stack_mosaic.Rd
   pkg/CHNOSZ/man/util.expression.Rd
   pkg/CHNOSZ/man/util.legend.Rd
   pkg/CHNOSZ/vignettes/multi-metal.Rmd
Log:
Move ibasis argument to first position in describe.basis()


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/DESCRIPTION	2023-02-15 12:50:13 UTC (rev 765)
@@ -1,6 +1,6 @@
-Date: 2023-02-10
+Date: 2023-02-15
 Package: CHNOSZ
-Version: 1.9.9-56
+Version: 1.9.9-57
 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/R/util.expression.R
===================================================================
--- pkg/CHNOSZ/R/util.expression.R	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/R/util.expression.R	2023-02-15 12:50:13 UTC (rev 765)
@@ -180,7 +180,7 @@
   return(desc)
 }
 
-describe.basis <- function(basis = thermo()$basis, ibasis = 1:nrow(basis),
+describe.basis <- function(ibasis = 1:nrow(basis), basis = thermo()$basis,
   digits = 1, oneline = FALSE, molality = FALSE, use.pH = TRUE) {
   # Make expressions for the chemical activities/fugacities of the basis species
   propexpr <- valexpr <- character()

Modified: pkg/CHNOSZ/demo/buffer.R
===================================================================
--- pkg/CHNOSZ/demo/buffer.R	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/demo/buffer.R	2023-02-15 12:50:13 UTC (rev 765)
@@ -35,7 +35,7 @@
 legend("topright", legend = c("minerals", "formaldehyde", "HCN"),
   lty = c(1, 3, 2), lwd = c(2, 1, 1), col = c(3, 1, 1), bg = "white", cex = 0.9)
 legend("bottomright", legend = c(describe.property("P", 300),
-  describe.basis(ibasis=c(2,4))), bg="white", cex=0.9)
+  describe.basis(c(2,4))), bg="white", cex=0.9)
 title(main=paste("Mineral buffers and activities of aqueous species",
                  "(Schulte and Shock, 1995)", sep="\n"), cex.main=0.9)
 

Modified: pkg/CHNOSZ/demo/comproportionation.R
===================================================================
--- pkg/CHNOSZ/demo/comproportionation.R	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/demo/comproportionation.R	2023-02-15 12:50:13 UTC (rev 765)
@@ -50,7 +50,7 @@
   plot.axes = {
     contour(T, pH, G.kJ.4, levels = c(-10, -30, -50), add = TRUE, col = "white", lwd = 2, labcex = 0.8)
     legend("topleft", legend = rxntext, bty = "n", inset = c(0, 0.03))
-    legend("topleft", describe.basis(ibasis = 1:2), bty = "n", inset = c(0, 0.08))
+    legend("topleft", describe.basis(1:2), bty = "n", inset = c(0, 0.08))
     lines(T, pK_H2S, lty = 2)
     text(85, 6.7, expr.species("HS-"))
     text(85, 6.3, expr.species("H2S"))

Modified: pkg/CHNOSZ/demo/gold.R
===================================================================
--- pkg/CHNOSZ/demo/gold.R	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/demo/gold.R	2023-02-15 12:50:13 UTC (rev 765)
@@ -68,7 +68,7 @@
   # Make legend and title
   dprop <- describe.property(c("T", "P", "IS"), c(300, 1000, 0))
   legend("topleft", dprop, bty = "n")
-  dbasis <- describe.basis(ibasis = c(9, 7))
+  dbasis <- describe.basis(c(9, 7))
   legend("bottomright", dbasis, bty = "n")
   title(main=("After Akinfiev and Zotov, 2001, Fig. 7"), font.main = 1)
 }
@@ -93,7 +93,7 @@
   # Make legend and title
   dprop <- describe.property(c("T", "P", "IS"), c(450, 1000, 0))
   legend("topleft", dprop, bty = "n")
-  dbasis <- describe.basis(ibasis = c(6, 9, 7))
+  dbasis <- describe.basis(c(6, 9, 7))
   legend("topright", dbasis, bty = "n")
   title(main=("After Stef\u00e1nsson and Seward, 2004, Fig. 12b"), font.main = 1, cex.main = 1.1)
 }
@@ -132,9 +132,9 @@
   dNaCl <- expression(italic(m)[NaCl] == 1.5)
   dKCl <- expression(italic(m)[KCl] == 0.5)
   legend("topleft", c(dP, dNaCl, dKCl), bty = "n")
-  dH2S <- describe.basis(ibasis = 7, molality=TRUE)
-  dO2 <- describe.basis(ibasis = 9)
-  dpH <- describe.basis(ibasis = 10)
+  dH2S <- describe.basis(7, molality=TRUE)
+  dO2 <- describe.basis(9)
+  dpH <- describe.basis(10)
   legend(300, -3, c(dH2S, dO2, dpH), bty = "n")
   title(main=("After Williams-Jones et al., 2009, Fig. 2B"), font.main = 1)
 }
@@ -167,8 +167,8 @@
   dKCl <- expression(italic(m)[KCl] == 0.5)
   legend("topleft", c(dP, dNaCl, dKCl), bty = "n")
   dH2S <- expr.species("H2S", value = 0.01, molality = TRUE)
-  dO2 <- describe.basis(ibasis = 9)
-  dpH <- describe.basis(ibasis = 10)
+  dO2 <- describe.basis(9)
+  dpH <- describe.basis(10)
   legend(300, -3, c(dH2S, dO2, dpH), bty = "n")
   title(main=("After Williams-Jones et al., 2009, Fig. 2A"), font.main = 1)
 }

Modified: pkg/CHNOSZ/demo/protbuff.R
===================================================================
--- pkg/CHNOSZ/demo/protbuff.R	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/demo/protbuff.R	2023-02-15 12:50:13 UTC (rev 765)
@@ -18,7 +18,7 @@
 fill <- ZC.col(ZC(protein.formula(species()$name)))
 diagram(e, fill=fill)
 title(main="Thiol peroxidases from bacteria")
-legend("topleft", describe.basis(thermo()$basis[-6,]), bg="slategray1", box.lwd=0)
+legend("topleft", describe.basis(basis = thermo()$basis[-6,]), bg="slategray1", box.lwd=0)
 
 ## Buffer + ionization: relative stabilities
 ## of E. coli sigma factors on a T-pH diagram
@@ -41,7 +41,7 @@
 diagram(a, normalize=FALSE, fill=fill)
 title(main=expression("Sigma factors in"~italic("E. coli")))
 ptext <- c(describe.property("T", 25), 
-  describe.basis(ibasis=c(2, 6), oneline=TRUE))
+  describe.basis(c(2, 6), oneline=TRUE))
 legend("topleft", legend=c("preset conditions:", ptext), bg="slategray1", box.lwd=0)
-btext <- describe.basis(ibasis=c(1, 3, 4, 5), oneline=TRUE)
+btext <- describe.basis(c(1, 3, 4, 5), oneline=TRUE)
 legend("bottomright", legend=c("buffered conditions:", btext), bg="slategray1", box.lwd=0)

Modified: pkg/CHNOSZ/demo/saturation.R
===================================================================
--- pkg/CHNOSZ/demo/saturation.R	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/demo/saturation.R	2023-02-15 12:50:13 UTC (rev 765)
@@ -33,5 +33,5 @@
 # add title and legend
 title(main = syslab(c("H2O", "CO2", "CaO", "MgO", "SiO2")))
 dprop <- describe.property(c("T", "P"), c(300, 1000))
-dbasis <- describe.basis(ibasis = 4)
+dbasis <- describe.basis(4)
 legend("bottomright", c(dprop, dbasis), bty = "n", cex = 0.9)

Modified: pkg/CHNOSZ/inst/NEWS.Rd
===================================================================
--- pkg/CHNOSZ/inst/NEWS.Rd	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/inst/NEWS.Rd	2023-02-15 12:50:13 UTC (rev 765)
@@ -12,7 +12,7 @@
 % links to vignettes 20220723
 \newcommand{\viglink}{\ifelse{html}{\out{<a href="../CHNOSZ/doc/#1.html"><strong>#1.Rmd</strong></a>}}{\bold{#1.Rmd}}}
 
-\section{Changes in CHNOSZ version 1.9.9-56 (2023-02-10)}{
+\section{Changes in CHNOSZ version 1.9.9-57 (2023-02-15)}{
 
   \subsection{MAJOR USER-VISIBLE CHANGES}{
     \itemize{
@@ -233,6 +233,9 @@
 
       \item Remove unused \samp{cutoff} value in \code{thermo()$opt}.
 
+      \item Move \strong{ibasis} argument to first position in
+      \code{describe.basis()}.
+
     }
   }
 

Modified: pkg/CHNOSZ/man/diagram.Rd
===================================================================
--- pkg/CHNOSZ/man/diagram.Rd	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/man/diagram.Rd	2023-02-15 12:50:13 UTC (rev 765)
@@ -273,7 +273,7 @@
 a <- affinity(pH=c(-1, 4, 256), pe=c(-5, 23, 256))
 d <- diagram(a, main="Fe-S-O-H, after Majzlan et al., 2006")
 water.lines(d, lwd=2)
-text(3, 22, describe.basis(thermo()$basis[2:3,], digits=2, oneline=TRUE))
+text(3, 22, describe.basis(2:3, digits=2, oneline=TRUE))
 text(3, 21, describe.property(c("T", "P"), c(25, 1), oneline=TRUE))
 
 ## aqueous Al species, after Tagirov and Schott, 2001

Modified: pkg/CHNOSZ/man/mix.Rd
===================================================================
--- pkg/CHNOSZ/man/mix.Rd	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/man/mix.Rd	2023-02-15 12:50:13 UTC (rev 765)
@@ -87,7 +87,7 @@
 ### rebalance() diagram
 ad <- rebalance(dFe, dCu)
 diagram(ad, xlab = xlab, balance = 1, main = "Cu-Fe-S-O-H with rebalance()")
-db <- describe.basis(ibasis = 3)
+db <- describe.basis(3)
 leg <- lex(lTP(400, 2000), db)
 legend("bottomleft", legend = leg, bty = "n")
 \dontshow{par(opar)}}

Modified: pkg/CHNOSZ/man/stack_mosaic.Rd
===================================================================
--- pkg/CHNOSZ/man/stack_mosaic.Rd	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/man/stack_mosaic.Rd	2023-02-15 12:50:13 UTC (rev 765)
@@ -102,7 +102,7 @@
   pH = pH, O2 = O2, T = T, P = P, IS = NaCl$IS)
 # Add legend and title
 lTP <- lex(lTP(T, P))
-db <- describe.basis(ibasis = c(3:4))
+db <- describe.basis(c(3:4))
 legend("topright", c(lTP, db), bg = "white")
 title("Fe-Cu-S-O-H-Cl", font.main = 1)
 }

Modified: pkg/CHNOSZ/man/util.expression.Rd
===================================================================
--- pkg/CHNOSZ/man/util.expression.Rd	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/man/util.expression.Rd	2023-02-15 12:50:13 UTC (rev 765)
@@ -20,7 +20,7 @@
   expr.units(property, prefix = "", per = "mol")
   axis.label(label, units = NULL, basis = thermo()$basis, prefix = "",
     molality = FALSE)
-  describe.basis(basis = thermo()$basis, ibasis = 1:nrow(basis),
+  describe.basis(ibasis = 1:nrow(basis), basis = thermo()$basis,
     digits = 1, oneline = FALSE, molality = FALSE, use.pH = TRUE)
   describe.property(property, value, digits = 0, oneline = FALSE,
     ret.val = FALSE)
@@ -43,8 +43,8 @@
   \item{per}{character, denominator in units}
   \item{label}{character, description of species, condition or property}
   \item{units}{character, description of units}
+  \item{ibasis}{numeric, which basis species to include}
   \item{basis}{data frame, definition of basis species}
-  \item{ibasis}{numeric, which basis species to include}
   \item{digits}{numeric, number of digits to show after decimal point}
   \item{oneline}{logical, make descriptions occupy a single line?}
   \item{ret.val}{logical, return only the value with the units?}
@@ -109,9 +109,9 @@
 This function is used extensively in \code{\link{diagram}} and also appears in many of the examples.
 Note that \code{\link{diagram}} sets \code{molality} to TRUE if \code{IS} was supplied as an argument to \code{\link{affinity}}.
 
-  \code{describe.basis} makes an expression summarizing the basis species definition (logarithms of activity or fugacity of the basis species) provided in \code{basis}; only the basis species identified by \code{ibasis} are included. 
+\code{describe.basis} makes an expression summarizing the basis species definition (logarithms of activity or fugacity of the basis species) provided in \code{basis}; only the basis species identified by \code{ibasis} are included. 
 
-  \code{describe.property} makes an expression summarizing the properties supplied in \code{property}, along with their \code{value}s. The expressions returned by both functions consist of a property, an equals sign, and a value (with units where appropriate); the expressions have a length equal to the number of property/value pairs. If \code{oneline} is TRUE, the property/value pairs are combined into a single line, separated by commas. The number of digits shown after the decimal point in the values is controlled by \code{digits}. If \code{ret.val} is TRUE, only the values and their units are returned; this is useful for labeling plots with values of temperature.
+\code{describe.property} makes an expression summarizing the properties supplied in \code{property}, along with their \code{value}s. The expressions returned by both functions consist of a property, an equals sign, and a value (with units where appropriate); the expressions have a length equal to the number of property/value pairs. If \code{oneline} is TRUE, the property/value pairs are combined into a single line, separated by commas. The number of digits shown after the decimal point in the values is controlled by \code{digits}. If \code{ret.val} is TRUE, only the values and their units are returned; this is useful for labeling plots with values of temperature.
 
 \code{describe.reaction} makes an expression summarizing a chemical reaction.
 The \code{reaction} data frame can be generated using \code{\link{subcrt}}.
@@ -168,7 +168,7 @@
 dprop <- describe.property(property, value, oneline=TRUE)
 text(3, 1.5, dbasis)
 text(3, 2.5, dprop)
-dbasis <- describe.basis(ibasis=c(1, 5))
+dbasis <- describe.basis(c(1, 5))
 dprop <- describe.property(property[1:2], value[1:2])
 legend(2.4, 3.9, legend=c(dbasis, dprop), bty="n")
 # describe.reaction

Modified: pkg/CHNOSZ/man/util.legend.Rd
===================================================================
--- pkg/CHNOSZ/man/util.legend.Rd	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/man/util.legend.Rd	2023-02-15 12:50:13 UTC (rev 765)
@@ -8,7 +8,7 @@
 \alias{lTP}
 \alias{lex}
 \title{Functions to Make Legend Text}
-\description{Generate expressions suitable plot legends describing system conditions.}
+\description{Generate expressions describing system conditions that can be added to legends of plots.}
 
 \usage{
   lNaCl(x, digits = 2)

Modified: pkg/CHNOSZ/vignettes/multi-metal.Rmd
===================================================================
--- pkg/CHNOSZ/vignettes/multi-metal.Rmd	2023-02-10 03:53:59 UTC (rev 764)
+++ pkg/CHNOSZ/vignettes/multi-metal.Rmd	2023-02-15 12:50:13 UTC (rev 765)
@@ -979,7 +979,7 @@
 title(bquote("Fe and/or Cu; 2° balance:" ~ .(expr.species("H+"))))
 label.plot("E")
 
-db <- describe.basis(ibasis = 3)
+db <- describe.basis(3)
 leg <- lex(lTP(400, 2000), db)
 legend("bottomleft", legend = leg, bty = "n")
 ```



More information about the CHNOSZ-commits mailing list