[CHNOSZ-commits] r780 - in pkg/CHNOSZ: . R inst man tests vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 14 00:54:01 CET 2023


Author: jedick
Date: 2023-03-14 00:54:01 +0100 (Tue, 14 Mar 2023)
New Revision: 780

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/rank.affinity.R
   pkg/CHNOSZ/inst/NEWS.Rd
   pkg/CHNOSZ/man/DEW.Rd
   pkg/CHNOSZ/man/mix.Rd
   pkg/CHNOSZ/man/util.plot.Rd
   pkg/CHNOSZ/tests/stack_mosaic.R
   pkg/CHNOSZ/tests/stack_mosaic.pdf
   pkg/CHNOSZ/vignettes/OBIGT.Rmd
   pkg/CHNOSZ/vignettes/OBIGT.bib
   pkg/CHNOSZ/vignettes/anintro.Rmd
Log:
Submit version 2.0.0 to CRAN


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2023-03-12 12:03:20 UTC (rev 779)
+++ pkg/CHNOSZ/DESCRIPTION	2023-03-13 23:54:01 UTC (rev 780)
@@ -1,6 +1,6 @@
-Date: 2023-03-12
+Date: 2023-03-13
 Package: CHNOSZ
-Version: 1.9.9-71
+Version: 2.0.0
 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/rank.affinity.R
===================================================================
--- pkg/CHNOSZ/R/rank.affinity.R	2023-03-12 12:03:20 UTC (rev 779)
+++ pkg/CHNOSZ/R/rank.affinity.R	2023-03-13 23:54:01 UTC (rev 780)
@@ -16,7 +16,10 @@
   })
   # Restore dims
   dims <- dim(aout$values[[1]])
-  glist <- apply(grank, 2, "dim<-", dims, simplify = FALSE)
+  # apply() got 'simplify' argument in R 4.1.0 20230313
+  # Using 'simplify = FALSE' in R < 4.1.0 caused error: 3 arguments passed to 'dim<-' which requires 2
+  if(getRversion() < "4.1.0") glist <- lapply(lapply(apply(grank, 2, list), "[[", 1), "dim<-", dims)
+  else glist <- apply(grank, 2, "dim<-", dims, simplify = FALSE)
   aout$values <- glist
   # Rename species to group names (for use by diagram())
   aout$species <- aout$species[1:length(groups), ]

Modified: pkg/CHNOSZ/inst/NEWS.Rd
===================================================================
--- pkg/CHNOSZ/inst/NEWS.Rd	2023-03-12 12:03:20 UTC (rev 779)
+++ pkg/CHNOSZ/inst/NEWS.Rd	2023-03-13 23:54:01 UTC (rev 780)
@@ -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-68 (2023-03-09)}{
+\section{Changes in CHNOSZ version 2.0.0 (2023-03-13)}{
 
   \subsection{MAJOR USER-VISIBLE CHANGES}{
     \itemize{
@@ -101,8 +101,8 @@
 
       \item Add \code{stack_mosaic()} to create stacked mosaic diagrams, where
       the species formed in the first layer become the basis species for the
-      species formed in the second layer. This function serves as a wrapper for the
-      steps for making mosaic diagrams for bimetallic systems described in
+      species formed in the second layer. This function implements the
+      procedure for making mosaic diagrams for bimetallic systems described in
       \viglink{multi-metal}.
 
       \item Add \code{loga_aq} argument to \code{mosiac()} (also present in new
@@ -199,8 +199,9 @@
       with bornite.
 
       \item Improve handling of non-integer coefficients in
-      \code{expr.species()}. The result for FeS1.33 was previously incorrectly
-      formatted as FeS\s{.33} but is now correctly formatted as FeS\s{1.33}.
+      \code{expr.species()}. For example, the result for FeS1.33 was previously
+      incorrectly formatted as FeS\s{.33} but is now correctly formatted as
+      FeS\s{1.33}.
 
     }
   }
@@ -208,10 +209,6 @@
   \subsection{OTHER CHANGES}{
     \itemize{
 
-      \item Most functions have been modified to use Joules in internal
-      variables. In particular, the value of the gas constant is expressed in
-      J K\S{-1} mol\S{-1} in \code{convert()} and other functions.
-
       \item The \code{\var{reaction}} component of the output of
       \code{subcrt()} contains the \code{model} for each species.
 

Modified: pkg/CHNOSZ/man/DEW.Rd
===================================================================
--- pkg/CHNOSZ/man/DEW.Rd	2023-03-12 12:03:20 UTC (rev 779)
+++ pkg/CHNOSZ/man/DEW.Rd	2023-03-13 23:54:01 UTC (rev 780)
@@ -26,7 +26,7 @@
 
 \details{
 The Deep Earth Water (DEW) model, described by Sverjensky et al., 2014, extends the applicability of the revised HKF equations of state to 60 kbar.
-This implementation of DEW is based on the VBA macro code in the May, 2017 version of the DEW spreadsheet downloaded from \url{http://www.dewcommunity.org/}.
+This implementation of DEW is based on the VBA macro code in the May, 2017 version of the DEW spreadsheet downloaded from http://www.dewcommunity.org/.
 The spreadsheet provides multiple options for some calculations; here the default equations for density of water (Zhang and Duan, 2005), dielectric constant (Sverjensky et al., 2014) and Gibbs energy of water (integral of volume, equation created by Brandon Harrison) are used.
 
 Comments in the original code indicate that \code{calculateGibbsOfWater} is valid for 100 \le \T \le 1000 \degC and \P \ge 1000 bar.

Modified: pkg/CHNOSZ/man/mix.Rd
===================================================================
--- pkg/CHNOSZ/man/mix.Rd	2023-03-12 12:03:20 UTC (rev 779)
+++ pkg/CHNOSZ/man/mix.Rd	2023-03-13 23:54:01 UTC (rev 780)
@@ -68,8 +68,12 @@
 More examples are in the vignette \viglink{multi-metal}.
 }
 
-\examples{\dontshow{opar <- par(no.readonly = TRUE)}
-par(mfrow = c(2, 2))
+\examples{
+# Don't make all plots because it takes more than
+# 10 seconds on CRAN checks 20230313
+plot.all <- FALSE
+if(plot.all) opar <- par(no.readonly = TRUE)
+if(plot.all) par(mfrow = c(2, 2))
 # Define basis species with Fe and Cu
 basis(c("Fe+2", "Cu+", "hydrogen sulfide", "oxygen", "H2O", "H+"))
 xlab <- ratlab("Fe+2", "Cu+")
@@ -76,14 +80,14 @@
 # Calculate diagram for only Fe-bearing minerals
 species(c("pyrite", "pyrrhotite", "magnetite", "hematite"))
 aFe <- affinity("Fe+2" = c(0, 12), O2 = c(-40, -16), T = 400, P = 2000)
-dFe <- diagram(aFe, xlab = xlab, main = "Fe-S-O-H")
+dFe <- diagram(aFe, xlab = xlab, main = "Fe-S-O-H", plot.it = plot.all)
 # Calculate diagram for only Cu-bearing minerals
 species(c("covellite", "chalcocite", "tenorite", "cuprite"))
 aCu <- affinity(aFe)  # argument recall
-dCu <- diagram(aCu, xlab = xlab, main = "Cu-S-O-H")
+dCu <- diagram(aCu, xlab = xlab, main = "Cu-S-O-H", plot.it = plot.all)
 ### mash() diagram
 ac <- mash(dFe, dCu)
-diagram(ac, xlab = xlab, main = "Cu-Fe-S-O-H with mash()")
+diagram(ac, xlab = xlab, main = "Cu-Fe-S-O-H with mash()", plot.it = plot.all)
 ### rebalance() diagram
 ad <- rebalance(dFe, dCu)
 diagram(ad, xlab = xlab, balance = 1, main = "Cu-Fe-S-O-H with rebalance()")
@@ -90,6 +94,6 @@
 db <- describe.basis(3)
 leg <- lex(lTP(400, 2000), db)
 legend("bottomleft", legend = leg, bty = "n")
-\dontshow{par(opar)}}
+if(plot.all) par(opar)}
 
 \concept{Extended workflow}

Modified: pkg/CHNOSZ/man/util.plot.Rd
===================================================================
--- pkg/CHNOSZ/man/util.plot.Rd	2023-03-12 12:03:20 UTC (rev 779)
+++ pkg/CHNOSZ/man/util.plot.Rd	2023-03-13 23:54:01 UTC (rev 780)
@@ -119,18 +119,8 @@
 basis(c("H2S", "H2O", "H+", "e-"))
 species(c("HS-", "H2S", "HSO4-", "SO4-2"))
 a <- affinity(pH = c(0, 12), Eh = c(-1, 1), T = 200)
-opar <- par(mfrow=c(2, 2))
 diagram(a, grid = "both")
 title(main = 'diagram(a, grid = "both")')
-diagram(a, grid = "major")
-title(main = 'diagram(a, grid = "major")')
-diagram(a, grid = "minor")
-title(main = 'diagram(a, grid = "minor")')
-diagram(a, fill = "terrain")
-thermo.axis(grid = "major", col.grid = "slategray")
-title(main = 'thermo.axis(grid = "major")')
-par(thermo()$opar)
-par(opar)
 }
 
 \concept{Utility functions}

Modified: pkg/CHNOSZ/tests/stack_mosaic.R
===================================================================
--- pkg/CHNOSZ/tests/stack_mosaic.R	2023-03-12 12:03:20 UTC (rev 779)
+++ pkg/CHNOSZ/tests/stack_mosaic.R	2023-03-13 23:54:01 UTC (rev 780)
@@ -170,7 +170,7 @@
 
 ## Add arrows and text
 plot.new()
-text(0.5, 0.99, "mosaic()\nWITHOUT 'loga_aq'\n(pre-2.0.0)", font = 2, xpd = NA)
+text(0.5, 0.99, "mosaic()\nWITHOUT 'loga_aq'", font = 2, xpd = NA)
 
 arrows(0.35, 0.9, 0.65, 0.9)
 text(0.5, 0.93, paste0("Test 1: Cu mineral reactions unaffected\n", T1result))

Modified: pkg/CHNOSZ/tests/stack_mosaic.pdf
===================================================================
(Binary files differ)

Modified: pkg/CHNOSZ/vignettes/OBIGT.Rmd
===================================================================
--- pkg/CHNOSZ/vignettes/OBIGT.Rmd	2023-03-12 12:03:20 UTC (rev 779)
+++ pkg/CHNOSZ/vignettes/OBIGT.Rmd	2023-03-13 23:54:01 UTC (rev 780)
@@ -226,7 +226,7 @@
 ```
 
 This file contains H<sub>2</sub>O, *e*<sup>-</sup>, and H<sup>+</sup>.
-The properties of H<sub>2</sub>O are listed as NA; CHNOSZ calculates its properties using a Fortran subroutine taken from SUPRCT92 ([Johnson et al., 1992](https://doi.org/10.1016/0098-3004(92)90029-Q)) (default) or using the IAPWS-95 equations ([Wagner and Pruß, 2002](https://doi.org/10.1063/1.1461829)) or the [Deep Earth Water](http://www.dewcommunity.org/) (DEW) model ([Sverjensky et al., 2014](https://doi.org/10.1016/j.gca.2013.12.019)).
+The properties of H<sub>2</sub>O are listed as NA; CHNOSZ calculates its properties using a Fortran subroutine taken from SUPRCT92 ([Johnson et al., 1992](https://doi.org/10.1016/0098-3004(92)90029-Q)) (default) or using the IAPWS-95 equations ([Wagner and Pruß, 2002](https://doi.org/10.1063/1.1461829)) or the Deep Earth Water (DEW) model ([Sverjensky et al., 2014](https://doi.org/10.1016/j.gca.2013.12.019)).
 
 By convention, the standard Gibbs energy of formation, entropy, and heat capacity of the aqueous proton (H<sup>+</sup>) are 0 at all *T* and *P* ([e.g. Cox et al., 1989](https://www.worldcat.org/oclc/18559968)).
 The formation reaction of the proton can be expressed as &frac12;H<sub>2,(*g*)</sub> + Z = H<sup>+</sup>, where Z is the "element" of positive charge.
@@ -359,9 +359,9 @@
 
 <div id="D-optional-DEW" style="display: none">
 ## <a id="optional-DEW" class="anchor"></a> `r setfile("DEW.csv")`
-The [Deep Earth Water](http://www.dewcommunity.org/) (DEW) model extends the applicability of the revised HKF equations of state to 60 kbar.
+The Deep Earth Water (DEW) model extends the applicability of the revised HKF equations of state to 60 kbar.
 Accuracy of the thermodynamic calculations at these conditions is improved by revised correlations for the <i>a</i><sub>1</sub> HKF parameter, as described by [Sverjensky et al. (2014)](https://doi.org/10.1016/j.gca.2013.12.019).
-The data here were taken from the May 2017 and January 2019 versions of the [DEW spreadsheet](http://www.dewcommunity.org/resources.html).
+The data here were taken from the May 2017 and January 2019 versions of the at http://www.dewcommunity.org/resources.html.
 The following species are present in the spreadsheet, but are not used here because the parameters are unchanged from the default database in CHNOSZ: B(OH)<sub>3</sub>, Br<sup>-</sup>, Ca<sup>+2</sup>, Cl<sup>-</sup>, Cs<sup>+</sup>, F<sup>-</sup>, H<sup>+</sup>, H<sub>2</sub>, He, I<sup>-</sup>, K<sup>+</sup>, Kr, Li<sup>+</sup>, Mg<sup>+2</sup>, Na<sup>+</sup>, Ne, O<sub>2</sub>, Rb<sup>+</sup>, Rn, SO<sub>4</sub><sup>-2</sup>.
 
 Besides using `add.OBIGT("DEW")` to load these data, you should also run `water("DEW")` to activate the DEW equations in CHNOSZ.

Modified: pkg/CHNOSZ/vignettes/OBIGT.bib
===================================================================
--- pkg/CHNOSZ/vignettes/OBIGT.bib	2023-03-12 12:03:20 UTC (rev 779)
+++ pkg/CHNOSZ/vignettes/OBIGT.bib	2023-03-13 23:54:01 UTC (rev 780)
@@ -1050,10 +1050,9 @@
 
 @Misc{DEW17,
   author       = {{DEW model}},
+  howpublished = {Last updated on 2017-05-19. Accessed on 2017-09-26.},
   title        = {{D}ew_model_may_2017.zip ({E}xcel spreadsheet)},
-  howpublished = {Last updated on 2017-05-19. Accessed on 2017-09-26.},
   year         = {2017},
-  url          = {http://www.dewcommunity.org/resources.html},
 }
 
 @Article{BL06,
@@ -1176,10 +1175,9 @@
 
 @Misc{BDat17,
   author       = {berman.dat},
+  howpublished = {Last updated on 2017-02-03. Accessed on 2017-05-04.},
   title        = {{D}ata file in {SUPCRT}92b.zip on the {DEW} website},
-  howpublished = {Last updated on 2017-02-03. Accessed on 2017-05-04.},
   year         = {2017},
-  url          = {http://www.dewcommunity.org/resources.html},
 }
 
 @Article{HDR06,
@@ -1706,7 +1704,6 @@
   howpublished = {Last updated on 2019-02-06. Accessed on 2020-06-30.},
   title        = {dew_2019.xlsm.zip ({E}xcel spreadsheet)},
   year         = {2019},
-  url          = {http://www.dewcommunity.org/resources.html},
 }
 
 @Article{SUF+98,

Modified: pkg/CHNOSZ/vignettes/anintro.Rmd
===================================================================
--- pkg/CHNOSZ/vignettes/anintro.Rmd	2023-03-12 12:03:20 UTC (rev 779)
+++ pkg/CHNOSZ/vignettes/anintro.Rmd	2023-03-13 23:54:01 UTC (rev 780)
@@ -1543,7 +1543,7 @@
 These data are included to help transition to the "higher solubility of quartz paradigm" [@WJ17], but are not included in the default database in order to maintain compatibility with existing data for minerals that are linked to the older aqueous `r sio2` data.
 See [<span style="color:blue">`demo(aluminum)`</span>](../demo) for an example.
 
-<span style="color:red">`add.OBIGT("DEW")`</span> -- These are aqueous species, with modified parameters, that are intended for use with the [Deep Earth Water](http://www.dewcommunity.org/) (DEW) model [@SHA14].
+<span style="color:red">`add.OBIGT("DEW")`</span> -- These are aqueous species, with modified parameters, that are intended for use with the Deep Earth Water (DEW) model [@SHA14].
 You should also run <span style="color:red">`water("DEW")`</span> to activate the equations in the model; then, they will be used by <span style="color:green">`subcrt()`</span> and <span style="color:green">`affinity()`</span>.
 Examples are in [<span style="color:blue">`demo(DEW)`</span>](../demo).
 
@@ -1586,7 +1586,7 @@
 However, the IAPWS-95 equations are useful for other applications, and may be extrapolated to a greater range of *T* and *P* than SUPCRT.
 See <span style="color:blue">`?water`</span> for more information, as well as the last example in <span style="color:blue">`?subcrt`</span>, where uncommenting the line for the `IAPWS95` option allows extrapolation to lower temperatures for supercooled water.
 
-An implementation of the [Deep Earth Water](http://www.dewcommunity.org/) (DEW) model is also available; see [Optional data](#optional-data) for more information.
+An implementation of the Deep Earth Water (DEW) model is also available; see [Optional data](#optional-data) for more information.
 
 # Functions outside the main workflow
 



More information about the CHNOSZ-commits mailing list