R/harmonicMean.R

Defines functions harmonicMean

Documented in harmonicMean harmonicMean

harmonicMean <-
function( index ){
  harmonic_mean <- rep(NA, length(levels(factor(index)))-1)
  for(i in 1:length(levels(factor(index)))-1){
     harmonic_mean[i] <- (2/((1/length(index[index == 0 ]))+(1/length(index[index == i]))))
  }
  return(harmonic_mean)
}

Try the Mulcom package in your browser

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

Mulcom documentation built on Nov. 8, 2020, 5:53 p.m.