R/linearAlgebra-vec_mean-dot.R

Defines functions .vec_mean_array .vec_mean

#' Vector Mean (Vector Input) - Dot Function
#'
#' @author Ivan Jacob Agaloos Pesigan
#'
#' @inherit vec_mean details return
#'
#' @param x Numeric vector.
#' @family Vectorization Functions
#' @keywords linearAlgebra operation dot
#' @noRd
.vec_mean <- function(x) {
  sum(x) / length(x)
}

#' Vector Mean (Array Input) - Dot Function
#'
#' @author Ivan Jacob Agaloos Pesigan
#'
#' @inherit vec_mean details return
#'
#' @param x Numeric array.
#' @family Vectorization Functions
#' @keywords linearAlgebra operation dot
#' @noRd
.vec_mean_array <- function(x) {
  dim(x) <- NULL
  sum(x) / length(x)
}
jeksterslab/linearAlgebra documentation built on Dec. 20, 2021, 10:10 p.m.