Browse code

Add ellipsis to rowProds so that `method` argument doesn't fail

Starts to address #7

const-ae authored on 28/09/2020 11:03:57
Showing 3 changed files

... ...
@@ -138,7 +138,7 @@ setMethod("colLogSumExps", signature(lx = "xgCMatrix"),
138 138
 #'
139 139
 #' @export
140 140
 setMethod("colProds", signature(x = "xgCMatrix"),
141
-          function(x, rows = NULL, cols = NULL, na.rm=FALSE){
141
+          function(x, rows = NULL, cols = NULL, na.rm=FALSE, ...){
142 142
   if(! is.null(rows)){
143 143
     x <- x[rows, , drop = FALSE]
144 144
   }
... ...
@@ -116,7 +116,7 @@ setMethod("rowLogSumExps", signature(lx = "xgCMatrix"),
116 116
 #' @rdname colProds-xgCMatrix-method
117 117
 #' @export
118 118
 setMethod("rowProds", signature(x = "xgCMatrix"),
119
-          function(x, rows = NULL, cols = NULL, na.rm=FALSE){
119
+          function(x, rows = NULL, cols = NULL, na.rm=FALSE, ...){
120 120
   if(! is.null(rows)){
121 121
     x <- x[rows, , drop = FALSE]
122 122
   }
... ...
@@ -5,9 +5,9 @@
5 5
 \alias{rowProds,xgCMatrix-method}
6 6
 \title{Calculates the product for each row (column) in a matrix}
7 7
 \usage{
8
-\S4method{colProds}{xgCMatrix}(x, rows = NULL, cols = NULL, na.rm = FALSE)
8
+\S4method{colProds}{xgCMatrix}(x, rows = NULL, cols = NULL, na.rm = FALSE, ...)
9 9
 
10
-\S4method{rowProds}{xgCMatrix}(x, rows = NULL, cols = NULL, na.rm = FALSE)
10
+\S4method{rowProds}{xgCMatrix}(x, rows = NULL, cols = NULL, na.rm = FALSE, ...)
11 11
 }
12 12
 \arguments{
13 13
 \item{x}{An NxK matrix-like object.}
... ...
@@ -22,6 +22,8 @@ done.}
22 22
 
23 23
 \item{na.rm}{If \code{\link[base:logical]{TRUE}}, \code{\link{NA}}s
24 24
 are excluded first, otherwise not.}
25
+
26
+\item{...}{Additional arguments passed to specific methods.}
25 27
 }
26 28
 \value{
27 29
 Returns a \code{\link{numeric}} \code{\link{vector}} of length N (K).