[CHNOSZ-commits] r617 - in pkg/CHNOSZ: . R demo inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 10 07:18:46 CET 2020


Author: jedick
Date: 2020-11-10 07:18:46 +0100 (Tue, 10 Nov 2020)
New Revision: 617

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/util.plot.R
   pkg/CHNOSZ/demo/arsenic.R
   pkg/CHNOSZ/demo/zinc.R
   pkg/CHNOSZ/inst/TODO
Log:
Make water.lines() work for any variable on x-axis


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2020-11-10 05:39:31 UTC (rev 616)
+++ pkg/CHNOSZ/DESCRIPTION	2020-11-10 06:18:46 UTC (rev 617)
@@ -1,6 +1,6 @@
 Date: 2020-11-10
 Package: CHNOSZ
-Version: 1.3.6-90
+Version: 1.3.6-91
 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.plot.R
===================================================================
--- pkg/CHNOSZ/R/util.plot.R	2020-11-10 05:39:31 UTC (rev 616)
+++ pkg/CHNOSZ/R/util.plot.R	2020-11-10 06:18:46 UTC (rev 617)
@@ -101,6 +101,9 @@
   xaxis <- eout$vars[1]
   yaxis <- eout$vars[2]
   xpoints <- eout$vals[[1]]
+  # make xaxis "nothing" if it is not pH, T, or P 20201110
+  # (so that horizontal water lines can be drawn for any non-redox variable on the x-axis)
+  if(!identical(xaxis, "pH") & !identical(xaxis, "T") & !identical(xaxis, "P")) xaxis <- "nothing"
 
   # T and P are constants unless they are plotted on one of the axes
   T <- eout$T

Modified: pkg/CHNOSZ/demo/arsenic.R
===================================================================
--- pkg/CHNOSZ/demo/arsenic.R	2020-11-10 05:39:31 UTC (rev 616)
+++ pkg/CHNOSZ/demo/arsenic.R	2020-11-10 06:18:46 UTC (rev 617)
@@ -26,12 +26,10 @@
 bases <- c("H2S", "HS-", "HSO4-", "SO4-2")
 # calculate affinties of formation reactions using the speciated S basis species
 m <- mosaic(bases, pH = c(0, 14, res), Eh = c(-0.8, 0.8, res), T = T, P = 1, blend = blend)
-# adjust colors and names
-fill <- rev(heat.colors(nrow(species())))
-fill[which(species()$state == "cr")] <- "slategray3"
+# adjust name of realgar
 m$A.species$species$name <- gsub(",alpha", "", m$A.species$species$name)
 # make the plot!
-diagram(m$A.species, fill = fill)
+diagram(m$A.species)
 # add legend and title
 dprop <- describe.property(c("T", "P"), c(T, P))
 legend("bottomleft", legend = dprop, bty = "n")

Modified: pkg/CHNOSZ/demo/zinc.R
===================================================================
--- pkg/CHNOSZ/demo/zinc.R	2020-11-10 05:39:31 UTC (rev 616)
+++ pkg/CHNOSZ/demo/zinc.R	2020-11-10 06:18:46 UTC (rev 617)
@@ -4,6 +4,7 @@
 # 20201008 combine solubility contours for different minerals
 # 20201014 added to CHNOSZ
 
+library(CHNOSZ)
 par(mfrow = c(2, 2))
 
 # system variables

Modified: pkg/CHNOSZ/inst/TODO
===================================================================
--- pkg/CHNOSZ/inst/TODO	2020-11-10 05:39:31 UTC (rev 616)
+++ pkg/CHNOSZ/inst/TODO	2020-11-10 06:18:46 UTC (rev 617)
@@ -1,3 +1,5 @@
+[to 20201110]
+
 - make a site for community uploaded data
 
 - make separate directories for default and optional data files
@@ -14,8 +16,6 @@
 
 - add check to mosaic() that 'stable' values have the right dimensions.
 
-- get water limits on logfO2-logfS2 diagram (multi-metal.Rmd)
-
 - anintro.Rmd, help files: make it clear that species with
 different units (cal, J) in OBIGT can be used in subcrt, diagrams, etc.
 in CHNOSZ.



More information about the CHNOSZ-commits mailing list