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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 2 11:54:27 CET 2019


Author: jedick
Date: 2019-03-02 11:54:27 +0100 (Sat, 02 Mar 2019)
New Revision: 416

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/util.data.R
   pkg/CHNOSZ/inst/CHECKLIST
   pkg/CHNOSZ/inst/NEWS
Log:
obigt2eos(): fix error using info() for AkDi species


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2019-03-01 14:55:07 UTC (rev 415)
+++ pkg/CHNOSZ/DESCRIPTION	2019-03-02 10:54:27 UTC (rev 416)
@@ -1,6 +1,6 @@
-Date: 2019-02-26
+Date: 2019-03-02
 Package: CHNOSZ
-Version: 1.3.0
+Version: 1.3.0-1
 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.data.R
===================================================================
--- pkg/CHNOSZ/R/util.data.R	2019-03-01 14:55:07 UTC (rev 415)
+++ pkg/CHNOSZ/R/util.data.R	2019-03-02 10:54:27 UTC (rev 416)
@@ -401,9 +401,11 @@
     # species in the Akinfiev-Diamond model (AkDi) have NA for Z 20190219
     isAkDi <- is.na(obigt$z.T)
     # remove scaling factors for the HKF species, but not for the AkDi species
-    obigt[!isAkDi, 13:20] <- t(t(obigt[!isAkDi, 13:20]) * 10^c(-1,2,0,4,0,4,5,0))
+    # protect this by an if statement to workaround error in subassignment to empty subset of data frame in R < 3.6.0
+    # (https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17483) 20190302
+    if(any(!isAkDi)) obigt[!isAkDi, 13:20] <- t(t(obigt[!isAkDi, 13:20]) * 10^c(-1,2,0,4,0,4,5,0))
     # for AkDi species, set NA values in remaining columns (for display only)
-    obigt[isAkDi, 16:19] <- NA
+    if(any(isAkDi)) obigt[isAkDi, 16:19] <- NA
     # if all of the species are AkDi, change the variable names
     if(all(isAkDi)) colnames(obigt)[13:20] <- c('a','b','xi','XX1','XX2','XX3','XX4','Z') 
     else colnames(obigt)[13:20] <- c('a1','a2','a3','a4','c1','c2','omega','Z') 

Modified: pkg/CHNOSZ/inst/CHECKLIST
===================================================================
--- pkg/CHNOSZ/inst/CHECKLIST	2019-03-01 14:55:07 UTC (rev 415)
+++ pkg/CHNOSZ/inst/CHECKLIST	2019-03-02 10:54:27 UTC (rev 416)
@@ -2,8 +2,6 @@
 release checklist for CHNOSZ
 ****************************
 
-- compile vignettes with release version number and date
-
 - run examples() and demos() to check their output
 
 - check output of demo("sources") to make sure all data sources are cited
@@ -34,6 +32,9 @@
 - reduce size of vignettes: after upgrading rmarkdown, replace files in
   rmarkdown/rmd/h/bootstrap/fonts/ with empty files
 
+- backwards compatibility: build and check the package with the
+  *minimum* R version (from the DESCRIPTION file)
+
 OTHER THINGS TO CHECK:
 
 - remove all "<<-" from sources (leftover from debugging)

Modified: pkg/CHNOSZ/inst/NEWS
===================================================================
--- pkg/CHNOSZ/inst/NEWS	2019-03-01 14:55:07 UTC (rev 415)
+++ pkg/CHNOSZ/inst/NEWS	2019-03-02 10:54:27 UTC (rev 416)
@@ -1,3 +1,12 @@
+CHANGES IN CHNOSZ 1.3.0-1 (2019-03-02)
+--------------------------------------
+
+- Fix unexported function obigt2eos(), which was affected by "Assignment
+  to empty subset of data.frame fails check of length of value"
+  (https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17483). The bug
+  caused errors in R-release (3.5.2) but not R-devel, when using info()
+  for species with the AkDi model.
+
 CHANGES IN CHNOSZ 1.3.0 (2019-02-26)
 ------------------------------------
 



More information about the CHNOSZ-commits mailing list