Browse code

Change preserve.shape to preserveShape to match matrixStats in colRanks

const-ae authored on 28/09/2020 11:04:35
Showing 3 changed files

... ...
@@ -672,7 +672,7 @@ setMethod("colCummaxs", signature(x = "dgCMatrix"),
672 672
 # colRanks
673 673
 
674 674
 #' @inherit MatrixGenerics::colRanks
675
-#' @param preserve.shape a boolean that specifies if the returned matrix has the same
675
+#' @param preserveShape a boolean that specifies if the returned matrix has the same
676 676
 #'   dimensions as the input matrix. By default this is true for `rowRanks()`, but false for
677 677
 #'   `colRanks()`.
678 678
 #' @param na.handling string specifying how `NA`s are handled. They can either be preserved with an `NA` rank
... ...
@@ -688,7 +688,7 @@ setMethod("colCummaxs", signature(x = "dgCMatrix"),
688 688
 #'    }
689 689
 #' @export
690 690
 setMethod("colRanks", signature(x = "dgCMatrix"),
691
-          function(x, rows = NULL, cols = NULL,  ties.method = c("max", "average", "min"), preserve.shape = FALSE, na.handling = c("keep", "last")){
691
+          function(x, rows = NULL, cols = NULL,  ties.method = c("max", "average", "min"), preserveShape = FALSE, na.handling = c("keep", "last")){
692 692
   if(! is.null(rows)){
693 693
     x <- x[rows, , drop = FALSE]
694 694
   }
... ...
@@ -698,9 +698,9 @@ setMethod("colRanks", signature(x = "dgCMatrix"),
698 698
   ties.method <- match.arg(ties.method,  c("max", "average", "min"))
699 699
   na.handling <- match.arg(na.handling, c("keep", "last"))
700 700
   if(ties.method == "average"){
701
-    dgCMatrix_colRanks_num(x, ties_method = ties.method, na_handling = na.handling, preserve_shape = preserve.shape)
701
+    dgCMatrix_colRanks_num(x, ties_method = ties.method, na_handling = na.handling, preserve_shape = preserveShape)
702 702
   }else{
703
-    dgCMatrix_colRanks_int(x, ties_method = ties.method, na_handling = na.handling, preserve_shape = preserve.shape)
703
+    dgCMatrix_colRanks_int(x, ties_method = ties.method, na_handling = na.handling, preserve_shape = preserveShape)
704 704
   }
705 705
 })
706 706
 
... ...
@@ -492,14 +492,14 @@ setMethod("rowCummaxs", signature(x = "dgCMatrix"),
492 492
 #' @rdname colRanks-dgCMatrix-method
493 493
 #' @export
494 494
 setMethod("rowRanks", signature(x = "dgCMatrix"),
495
-          function(x, rows = NULL, cols = NULL,  ties.method = c("max", "average", "min"), preserve.shape = TRUE, na.handling = c("keep", "last")){
495
+          function(x, rows = NULL, cols = NULL,  ties.method = c("max", "average", "min"), preserveShape = TRUE, na.handling = c("keep", "last")){
496 496
   if(! is.null(rows)){
497 497
     x <- x[rows, , drop = FALSE]
498 498
   }
499 499
   if(! is.null(cols)){
500 500
     x <- x[, cols, drop = FALSE]
501 501
   }
502
-  colRanks(t(x), ties.method = ties.method, preserve.shape = !preserve.shape, na.handling = na.handling)
502
+  colRanks(t(x), ties.method = ties.method, preserveShape = ! preserveShape, na.handling = na.handling)
503 503
 })
504 504
 
505 505
 
... ...
@@ -11,7 +11,7 @@ object}
11 11
   rows = NULL,
12 12
   cols = NULL,
13 13
   ties.method = c("max", "average", "min"),
14
-  preserve.shape = FALSE,
14
+  preserveShape = FALSE,
15 15
   na.handling = c("keep", "last")
16 16
 )
17 17
 
... ...
@@ -39,7 +39,7 @@ done.}
39 39
 that the default specifies fewer options than the original matrixStats
40 40
 package.}
41 41
 
42
-\item{preserve.shape}{a boolean that specifies if the returned matrix has the same
42
+\item{preserveShape}{a boolean that specifies if the returned matrix has the same
43 43
 dimensions as the input matrix. By default this is true for `rowRanks()`, but false for
44 44
 `colRanks()`.}
45 45