[CHNOSZ-commits] r19 - pkg/CHNOSZ/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Sep 23 12:28:46 CEST 2012


Author: jedick
Date: 2012-09-23 12:28:46 +0200 (Sun, 23 Sep 2012)
New Revision: 19

Modified:
   pkg/CHNOSZ/R/revisit.R
Log:
handle array of Astar in revisit(target="DGT")


Modified: pkg/CHNOSZ/R/revisit.R
===================================================================
--- pkg/CHNOSZ/R/revisit.R	2012-09-23 01:46:49 UTC (rev 18)
+++ pkg/CHNOSZ/R/revisit.R	2012-09-23 10:28:46 UTC (rev 19)
@@ -244,7 +244,10 @@
   } else if(target.lower=="dgt") {
     # Gibbs energy of transformation to the observed assemblage 
     actarr <- list2array(logact)
-    Astararr <- list2array(d$Astar)
+    # select species, vectorize, then put the Astar values into an array
+    Astar <- d$Astar[ispecies]
+    for(i in 1:ns) Astar[[i]] <- as.vector(Astar[[i]])
+    Astararr <- list2array(Astar)
     Gfun <- function(i, actarr, Astararr) {
       loga.equil <- actarr[i, ]
       Astar <- Astararr[i, ]



More information about the CHNOSZ-commits mailing list