R/row_SE.R

Defines functions rowSE

Documented in rowSE

#'Get standard error of the mean for rows in a matrix
#'
#' @description rowSE() calculates row-wise standard error of the mean for a matrix
#'
#' @param matrix a matrix
#' 
#' @keywords rowSE()
#' @export
#' @return a numerical vector
#' @examples
#' row_Std_Err <- rowSE(matrix)

rowSE <- function(matrix) {
  std_error <- function(x) { sd(x)/sqrt(length(x)) }
  SE <- apply(matrix, 1, std_error)
  return(SE)
}
jacobheng/cellwrangler documentation built on Aug. 12, 2019, 6:49 a.m.