R/sumByDims.R

Defines functions sumByDims

Documented in sumByDims

#'
#'@title Sum array by specified dimensions
#'
#'@description Function to sum array by specified dimensions.
#'
#'@param n - array to sum
#'@param dims - vector of indices for dimension to sum by
#'
#'@return array with dimensions used for summing
#'
#'@export
#'
sumByDims<-function(n,dims=1){
    sm<-apply(n,dims,sum);
    return(sm);
}
wStockhausen/rTCSAM2015 documentation built on May 3, 2019, 7:14 p.m.