[CHNOSZ-commits] r323 - in pkg/CHNOSZ: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Sep 15 14:38:46 CEST 2018


Author: jedick
Date: 2018-09-15 14:38:45 +0200 (Sat, 15 Sep 2018)
New Revision: 323

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/makeup.R
Log:
makeup(): do not passthrough a named character object


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2018-08-30 05:54:09 UTC (rev 322)
+++ pkg/CHNOSZ/DESCRIPTION	2018-09-15 12:38:45 UTC (rev 323)
@@ -1,6 +1,6 @@
-Date: 2018-08-30
+Date: 2018-09-15
 Package: CHNOSZ
-Version: 1.1.3-30
+Version: 1.1.3-31
 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/makeup.R
===================================================================
--- pkg/CHNOSZ/R/makeup.R	2018-08-30 05:54:09 UTC (rev 322)
+++ pkg/CHNOSZ/R/makeup.R	2018-09-15 12:38:45 UTC (rev 323)
@@ -8,8 +8,11 @@
   if(is.matrix(formula)) 
     return(lapply(seq_len(nrow(formula)), 
       function(i) makeup(formula[i, ])))
-  # a named object or list of named objects is returned untouched
-  if(!is.null(names(formula))) return(formula)
+  # a named numeric object is returned untouched
+  # (needed for recursive operation of the function?
+  #  - if this is not done it messes up the HOX example in protein.info.Rd)
+  if(!is.null(names(formula)) & is.numeric(formula)) return(formula)
+  # a list of named objects is also returned untouched
   if(is.list(formula) & !is.null(names(formula[[1]]))) return(formula)
   # prepare to multiply the formula by the multiplier, if given
   if(length(multiplier) > 1 & length(multiplier) != length(formula))



More information about the CHNOSZ-commits mailing list