[CHNOSZ-commits] r591 - in pkg/CHNOSZ: . R vignettes
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jul 28 10:39:16 CEST 2020
Author: jedick
Date: 2020-07-28 10:39:16 +0200 (Tue, 28 Jul 2020)
New Revision: 591
Modified:
pkg/CHNOSZ/DESCRIPTION
pkg/CHNOSZ/R/mix.R
pkg/CHNOSZ/vignettes/multi-metal.Rmd
Log:
Fix for previous R versions (no 'simplify' argument in apply())
Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION 2020-07-28 08:02:07 UTC (rev 590)
+++ pkg/CHNOSZ/DESCRIPTION 2020-07-28 08:39:16 UTC (rev 591)
@@ -1,6 +1,6 @@
Date: 2020-07-28
Package: CHNOSZ
-Version: 1.3.6-64
+Version: 1.3.6-65
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/mix.R
===================================================================
--- pkg/CHNOSZ/R/mix.R 2020-07-28 08:02:07 UTC (rev 590)
+++ pkg/CHNOSZ/R/mix.R 2020-07-28 08:39:16 UTC (rev 591)
@@ -63,7 +63,7 @@
# Remove combinations of a species with itself
combs <- combs[combs[, 1] != combs[, 2], ]
# Remove duplicated combinations
- isdup <- duplicated(lapply(apply(combs, 1, sort, simplify = FALSE), paste))
+ isdup <- duplicated(paste(apply(combs, 1, sort)[1, ], apply(combs, 1, sort)[2, ]))
combs <- combs[!isdup, ]
}
# Get species rows for each combination
Modified: pkg/CHNOSZ/vignettes/multi-metal.Rmd
===================================================================
--- pkg/CHNOSZ/vignettes/multi-metal.Rmd 2020-07-28 08:02:07 UTC (rev 590)
+++ pkg/CHNOSZ/vignettes/multi-metal.Rmd 2020-07-28 08:39:16 UTC (rev 591)
@@ -294,7 +294,7 @@
# 1:1 mixture (Fe:V)
a11 <- mix(dFe, dV, dFeV, c(1, 1))
d11 <- diagram(a11, fill = fill(a11), min.area = 0.01)
-water.lines(d11, col = 2)
+water.lines(d11, col = "orangered")
# Calculate affinity of FeVO4
species("FeVO4")
@@ -307,15 +307,15 @@
image(aFeVO4_vs_stable, col = topo.colors(100, 0.7, TRUE), add = TRUE)
par(opar)
diagram(a11, add = TRUE, names = FALSE)
-water.lines(d11, col = 2)
+water.lines(d11, col = "orangered")
thermo.axis()
imax <- arrayInd(which.max(aFeVO4_vs_stable), dim(aFeVO4_vs_stable))
pH <- d11$vals$pH[imax[1]]
Eh <- d11$vals$Eh[imax[2]]
-points(pH, Eh, pch = 10, cex = 2, lwd = 2, col = 7)
+points(pH, Eh, pch = 10, cex = 2, lwd = 2, col = "gold")
stable <- d11$names[d11$predominant[imax]]
-text(pH, Eh, stable, adj = c(0.5, -1), cex = 1.2, col = 7)
+text(pH, Eh, stable, adj = c(0.5, -1), cex = 1.2, col = "gold")
```
We then compute the affinity for formation of a metastable material, in this case triclinic FeVO~4~, from the same basis species used to make the previous diagrams.
@@ -333,9 +333,9 @@
imax <- arrayInd(which.max(aFeVO4_vs_stable), dim(aFeVO4_vs_stable))
pH <- d11$vals$pH[imax[1]]
Eh <- d11$vals$Eh[imax[2]]
-points(pH, Eh, pch = 10, cex = 2, lwd = 2, col = 7)
+points(pH, Eh, pch = 10, cex = 2, lwd = 2, col = "gold")
stable <- d11$names[d11$predominant[imax]]
-text(pH, Eh, stable, adj = c(0.3, 2), cex = 1.2, col = 7)
+text(pH, Eh, stable, adj = c(0.3, 2), cex = 1.2, col = "gold")
range(aFeVO4_vs_stable[d11$predominant == d11$predominant[imax]])
```
More information about the CHNOSZ-commits
mailing list