This makes sparseMatrixStats compatible with v0.60 of matrixStats

In this commit
* I introduce a set of function called set_result_names()
that take the internally computed result and add correct names if needed
* Add colnames to the matrices of the unit tests
* Update the documentation to reflect the changed method signatures

const-ae authored on 05/08/2021 13:05:38
Showing 1 changed files
 ... ... @@ -6,9 +6,25 @@ 6 6 \title{Calculates the standard deviation of the difference between each element of 7 7 a row (column) of a matrix-like object} 8 8 \usage{ 9 -\S4method{colSdDiffs}{dgCMatrix}(x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0) 9 +\S4method{colSdDiffs}{dgCMatrix}( 10 + x, 11 + rows = NULL, 12 + cols = NULL, 13 + na.rm = FALSE, 14 + diff = 1L, 15 + trim = 0, 16 + useNames = NA 17 +) 10 18 11 -\S4method{rowSdDiffs}{dgCMatrix}(x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0) 19 +\S4method{rowSdDiffs}{dgCMatrix}( 20 + x, 21 + rows = NULL, 22 + cols = NULL, 23 + na.rm = FALSE, 24 + diff = 1L, 25 + trim = 0, 26 + useNames = NA 27 +) 12 28 } 13 29 \arguments{ 14 30 \item{x}{An NxK matrix-like object.} ... ... @@ -28,6 +44,8 @@ are excluded first, otherwise not.} 28 44 29 45 \item{trim}{A double in [0,1/2] specifying the fraction of observations to 30 46 be trimmed from each end of (sorted) x before estimation.} 47 + 48 +\item{useNames}{If \code{\link{NA}}, the default behavior of the function about naming support is remained. If \code{\link{FALSE}}, no naming support is done. Else if \code{\link{TRUE}}, names attributes of result are set.} 31 49 } 32 50 \value{ 33 51 Returns a \code{\link{numeric}} \code{\link{vector}} of length N (K).

const-ae authored on 21/05/2020 11:07:40
Showing 1 changed files
 ... ... @@ -39,8 +39,8 @@ a row (column) of a matrix-like object. 39 39 \details{ 40 40 The S4 methods for \code{x} of type \code{\link{matrix}}, 41 41 \code{\link{array}}, or \code{\link{numeric}} call 42 -\code{matrixStats::\link[matrixStats]{rowSdDiffs}} 43 -/ \code{matrixStats::\link[matrixStats:rowSdDiffs]{colSdDiffs}}. 42 +\code{matrixStats::rowSdDiffs} 43 +/ \code{matrixStats::colSdDiffs}. 44 44 } 45 45 \examples{ 46 46 mat <- matrix(rnorm(15), nrow = 5, ncol = 3) ... ... @@ -55,8 +55,8 @@ mat <- matrix(rnorm(15), nrow = 5, ncol = 3) 55 55 } 56 56 \seealso{ 57 57 \itemize{ 58 -\item \code{matrixStats::\link[matrixStats]{rowSdDiffs}()} and 59 -\code{matrixStats::\link[matrixStats:rowSdDiffs]{colSdDiffs}()} which are 58 +\item \code{matrixStats::\link[matrixStats:varDiff]{rowSdDiffs}()} and 59 +\code{matrixStats::\link[matrixStats:varDiff]{colSdDiffs}()} which are 60 60 used when the input is a \code{matrix} or \code{numeric} vector. 61 61 \item for the direct standard deviation see \code{\link[MatrixGenerics:rowSds]{rowSds()}}. 62 62 }

#### Bring documentation in line with updates from MatrixGenerics

See https://github.com/Bioconductor/MatrixGenerics/issues/11

const-ae authored on 24/04/2020 07:36:21
Showing 1 changed files

#### Remove superfluous ... from method signatures

const-ae authored on 03/04/2020 10:39:05
Showing 1 changed files
 ... ... @@ -6,25 +6,9 @@ 6 6 \title{Calculates the standard deviation of the difference between each element of 7 7 a row (column) of a matrix-like object} 8 8 \usage{ 9 -\S4method{colSdDiffs}{dgCMatrix}( 10 - x, 11 - rows = NULL, 12 - cols = NULL, 13 - na.rm = FALSE, 14 - diff = 1L, 15 - trim = 0, 16 - ... 17 -) 9 +\S4method{colSdDiffs}{dgCMatrix}(x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0) 18 10 19 -\S4method{rowSdDiffs}{dgCMatrix}( 20 - x, 21 - rows = NULL, 22 - cols = NULL, 23 - na.rm = FALSE, 24 - diff = 1L, 25 - trim = 0, 26 - ... 27 -) 11 +\S4method{rowSdDiffs}{dgCMatrix}(x, rows = NULL, cols = NULL, na.rm = FALSE, diff = 1L, trim = 0) 28 12 } 29 13 \arguments{ 30 14 \item{x}{An NxK matrix-like object.} ... ... @@ -44,8 +28,6 @@ are excluded first, otherwise not.} 44 28 45 29 \item{trim}{A double in [0,1/2] specifying the fraction of observations to 46 30 be trimmed from each end of (sorted) x before estimation.} 47 - 48 -\item{...}{Additional arguments passed to specific methods.} 49 31 } 50 32 \value{ 51 33 Returns a \code{\link[base]{numeric}} \code{\link[base]{vector}} of

#### Bring documentation in line with MatrixGenerics

const-ae authored on 03/04/2020 10:19:46
Showing 1 changed files