R/colWeightedSds.R

### ============================================================================
### colWeightedSds
###

### ----------------------------------------------------------------------------
### Exported methods
###

# ------------------------------------------------------------------------------
# General method
#

#' @inherit MatrixGenerics::colWeightedSds
#' @importMethodsFrom DelayedArray seed
#' @rdname colWeightedVars
#' @export
#' @template example_dm_Rle
#' @author Peter Hickey
#' @examples
#'
#' colWeightedSds(dm_Rle, w = 1 / rowMeans2(dm_Rle))
setMethod("colWeightedSds", "DelayedMatrix",
          function(x, w = NULL, rows = NULL, cols = NULL, na.rm = FALSE,
                   force_block_processing = FALSE, ...) {
            sqrt(colWeightedVars(
              x = x,
              w = w,
              rows = rows,
              cols = cols,
              na.rm = na.rm,
              force_block_processing = force_block_processing,
              ...))
          }
)

Try the DelayedMatrixStats package in your browser

Any scripts or data that you put into this service are public.

DelayedMatrixStats documentation built on Feb. 5, 2021, 2:04 a.m.