R/meanmatrix.R

Defines functions mean.matrix

mean.matrix<-function(x, na.rm=FALSE, ...){
  if(is.matrix(x)){
    if(na.rm){
      object<-na.omit(x)
    } else {
      object<-x
    }
    SampleSize<-nrow(object)
    out<-(t(object)%*%object)/SampleSize
    return(out)
  } else {warning("x has to be a matrix")}
}
mcl868/HelpPackage documentation built on March 30, 2020, 4:11 p.m.