[CHNOSZ-commits] r594 - in pkg/CHNOSZ: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 11 03:24:48 CEST 2020


Author: jedick
Date: 2020-08-11 03:24:46 +0200 (Tue, 11 Aug 2020)
New Revision: 594

Removed:
   pkg/CHNOSZ/R/util.matrix.R
   pkg/CHNOSZ/man/util.matrix.Rd
Modified:
   pkg/CHNOSZ/DESCRIPTION
   pkg/CHNOSZ/NAMESPACE
   pkg/CHNOSZ/R/examples.R
   pkg/CHNOSZ/man/CHNOSZ-package.Rd
Log:
Remove invertible.combs() (was a supporting function for wjd())


Modified: pkg/CHNOSZ/DESCRIPTION
===================================================================
--- pkg/CHNOSZ/DESCRIPTION	2020-08-11 00:57:48 UTC (rev 593)
+++ pkg/CHNOSZ/DESCRIPTION	2020-08-11 01:24:46 UTC (rev 594)
@@ -1,6 +1,6 @@
 Date: 2020-08-11
 Package: CHNOSZ
-Version: 1.3.6-67
+Version: 1.3.6-68
 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/NAMESPACE
===================================================================
--- pkg/CHNOSZ/NAMESPACE	2020-08-11 00:57:48 UTC (rev 593)
+++ pkg/CHNOSZ/NAMESPACE	2020-08-11 01:24:46 UTC (rev 594)
@@ -19,7 +19,7 @@
   "add.OBIGT", "RH2OBIGT",
   "expr.property", "expr.units",
   "mass", "entropy", "GHS", "water",
-  "i2A", "invertible.combs",
+  "i2A",
   "dPdTtr", "Ttr",
   "count.aa", "nucleic.complement", "nucleic.formula",
   "rho.IAPWS95", "IAPWS95", "water.AW90", "WP02.auxiliary", "water.IAPWS95",

Modified: pkg/CHNOSZ/R/examples.R
===================================================================
--- pkg/CHNOSZ/R/examples.R	2020-08-11 00:57:48 UTC (rev 593)
+++ pkg/CHNOSZ/R/examples.R	2020-08-11 01:24:46 UTC (rev 594)
@@ -7,7 +7,7 @@
   .ptime <- proc.time()
   topics <- c("thermo", "examples",
     "util.array", "util.blast", "util.data", "util.expression", "util.legend", "util.plot",
-    "util.fasta", "util.formula", "util.matrix", "util.misc", "util.seq", "util.units",
+    "util.fasta", "util.formula", "util.misc", "util.seq", "util.units",
     "util.water", "taxonomy", "info", "retrieve", "add.OBIGT", "protein.info",
     "hkf", "water", "IAPWS95", "subcrt", "berman",
     "makeup", "basis", "swap.basis", "species", "affinity",

Deleted: pkg/CHNOSZ/R/util.matrix.R
===================================================================
--- pkg/CHNOSZ/R/util.matrix.R	2020-08-11 00:57:48 UTC (rev 593)
+++ pkg/CHNOSZ/R/util.matrix.R	2020-08-11 01:24:46 UTC (rev 594)
@@ -1,25 +0,0 @@
-# CHNOSZ/util.matrix.R
-# miscellaneous functions for matrices
-
-invertible.combs <- function(A, nmax=20) {
-  # given a matrix A, with number of rows equal to or greater 
-  # than the number of columns, return the combinations of row 
-  # numbers that constitute invertible square matrices  20111126 jmd
-  # start with all combinations
-  # nmax: don't consider more than this many rows (to save time for large systems)
-  nr <- min(nrow(A), nmax)
-  combs <- t(combn(nr, ncol(A)))
-  ic <- numeric()
-  zero <- sqrt(.Machine$double.eps)
-  # loop over the combinations
-  for(i in 1:nrow(combs)) {
-    # a slow method, actually calculating the inverse
-    #tt <- try(solve(A[combs[i,],]),silent=TRUE)
-    #if(!inherits(tt, "try-error")) ic <- c(ic,i)
-    # it's faster just to test if the determinant is non-zero
-    d <- det(A[combs[i,],])
-    if(abs(d) > zero) ic <- c(ic, i)
-  }
-  return(combs[ic,,drop=FALSE])
-}
-

Modified: pkg/CHNOSZ/man/CHNOSZ-package.Rd
===================================================================
--- pkg/CHNOSZ/man/CHNOSZ-package.Rd	2020-08-11 00:57:48 UTC (rev 593)
+++ pkg/CHNOSZ/man/CHNOSZ-package.Rd	2020-08-11 01:24:46 UTC (rev 594)
@@ -26,7 +26,7 @@
   \item Water properties: \code{\link{water}}, \code{\link{util.water}}, \code{\link{DEW}}, \code{\link{IAPWS95}}
   \item Protein properties: \code{\link{protein.info}}, \code{\link{add.protein}}, \code{\link{util.fasta}}, \code{\link{util.protein}}, \code{\link{util.seq}}, \code{\link{ionize.aa}}
   \item Other tools: \code{\link{examples}}, \code{\link{eqdata}}, \code{\link{taxonomy}}, \code{\link{util.blast}}
-  \item Utility functions: \code{\link{util.expression}}, \code{\link{util.plot}}, \code{\link{util.array}}, \code{\link{util.matrix}}, \code{\link{util.list}}, \code{\link{util.test}}, \code{\link{palply}}
+  \item Utility functions: \code{\link{util.expression}}, \code{\link{util.plot}}, \code{\link{util.array}}, \code{\link{util.list}}, \code{\link{util.test}}, \code{\link{palply}}
 }
 These concept entries are visible to \code{\link{help.search}} (aka \code{??}).
 For example, help pages related to thermodynamic data can be listed using \code{??"thermodynamic data"}.

Deleted: pkg/CHNOSZ/man/util.matrix.Rd
===================================================================
--- pkg/CHNOSZ/man/util.matrix.Rd	2020-08-11 00:57:48 UTC (rev 593)
+++ pkg/CHNOSZ/man/util.matrix.Rd	2020-08-11 01:24:46 UTC (rev 594)
@@ -1,45 +0,0 @@
-\encoding{UTF-8}
-\name{util.matrix}
-\alias{util.matrix}
-\alias{invertible.combs}
-\title{Functions for Various Matrix Operations}
-\description{
-  Find rows of a matrix that form invertible (linearly independent) combinations.
-}
-
-\usage{
-  invertible.combs(A, nmax=20)
-}
-
-\arguments{
-  \item{A}{A matrix, with at least as many rows as columns.}
-  \item{nmax}{The maximum number of rows to consider.}
-}
-
-\details{
-  Given a matrix \code{A}, with number of rows equal to or greater than the number of columns, return the combinations of row numbers that constitute invertible square matrices. Consider only the first \code{nmax} rows of the original matrix (to save time for large systems).
-}
-
-\examples{\dontshow{reset()}
-## what combinations of the 20 common amino acids have
-## a linearly independent stoichiometry with five elements?
-# the names of the amino acids
-aanames <- aminoacids("")
-# their species indices
-iaa <- suppressMessages(info(aanames))
-# the full stoichiometric matrix
-A <- i2A(iaa)
-# the invertible combinations
-icA <- invertible.combs(A)
-stopifnot(nrow(icA)==6067)
-# that's a bit less than 40% of all possible combinations
-nrow(icA) / ncol(combn(20, 5))
-# count the occurrences of each amino acid
-counts <- table(icA)
-names(counts) <- aminoacids(1)
-(sc <- sort(counts))
-# the two sulfur-containing ones show up most frequently
-stopifnot(tail(names(sc), 2)==c("C", "M"))
-}
-
-\concept{Utility functions}



More information about the CHNOSZ-commits mailing list