R/rclust.dist.R

Defines functions rclust.dist

Documented in rclust.dist

rclust.dist <- 
function(groups, dist) {
  c<-length(table(groups))
  wts <- rclust.weights(groups, dist)
  finals<-NULL
  for (i in 1:c) {
    grp.ids<-which(groups==i)
    finals<-rbind(finals,colSums(wts[grp.ids,])/length(grp.ids))
  }
  colnames(finals)<-levels(as.factor(groups))
  rownames(finals)<-levels(as.factor(groups))
  return(finals)
}

Try the fossil package in your browser

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

fossil documentation built on March 23, 2020, 5:06 p.m.