R/get_median.R

Defines functions get_median

get_median <-
function(data){
  if(nrow(data)==2){
    med_curve=colMeans(data)
  }else{
    depth=fMBD(t(data))
    med=which(depth==max(depth))[1]
    med_curve=data[med,]
  }
  return(med_curve)
}

Try the ftsa package in your browser

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

ftsa documentation built on May 29, 2024, 2:47 a.m.