R/std.error.R

Defines functions std.error

Documented in std.error

std.error<-function(x,na.rm) {
 vn<-function(x) return(sum(!is.na(x)))
 dimx<-dim(x)
 if(is.null(dimx)) {
  stderr<-sd(x,na.rm=TRUE)
  vnx<-vn(x)
 }
 else {
  if(is.data.frame(x)) {
   vnx<-unlist(sapply(x,vn))
   stderr<-unlist(sapply(x,sd,na.rm=TRUE))
  }
  else {
   vnx<-unlist(apply(x,2,vn))
   stderr<-unlist(apply(x,2,sd,na.rm=TRUE))
  }
 }
 return(stderr/sqrt(vnx))  
}

Try the plotrix package in your browser

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

plotrix documentation built on Nov. 10, 2023, 5:07 p.m.