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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Apr 13 03:04:01 CEST 2019


Author: jedick
Date: 2019-04-13 03:04:00 +0200 (Sat, 13 Apr 2019)
New Revision: 433

Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/R/add.obigt.R
Log:
mod.obigt(): improve error message for unnamed arguments


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2019-04-12 14:18:01 UTC (rev 432)
+++ pkg/CHNOSZ/DESCRIPTION	2019-04-13 01:04:00 UTC (rev 433)
@@ -1,6 +1,6 @@
-Date: 2019-04-12
+Date: 2019-04-13
 Package: CHNOSZ
-Version: 1.3.1-13
+Version: 1.3.1-14
 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/add.obigt.R
===================================================================
--- pkg/CHNOSZ/R/add.obigt.R	2019-04-12 14:18:01 UTC (rev 432)
+++ pkg/CHNOSZ/R/add.obigt.R	2019-04-13 01:04:00 UTC (rev 433)
@@ -26,7 +26,8 @@
   # this is needed if we are called with a list as the actual argument
   if(is.list(args[[1]])) args <- args[[1]]
   if(length(args) < 2) stop("please supply at least a species name and a property to update")
-  if(is.null(names(args))) stop("please supply named arguments")
+  if(is.null(names(args))) stop("all arguments after the first should be named")
+  if(any(tail(nchar(names(args)), -1)==0)) stop("all arguments after the first should be named")
   # if the first argument is numeric, it's the species index
   if(is.numeric(args[[1]][1])) {
     ispecies <- args[[1]]



More information about the CHNOSZ-commits mailing list