R/matjeffreys.R

Defines functions matjeffreys

Documented in matjeffreys

matjeffreys <-
function(x)  {
  if (!is.folder(x))
    stop("x must be an object of class 'folder'.")
  if (any(!apply(x[[1]], 2, is.numeric)))
    stop("Non numeric column(s) in the data frames in x.")

  distances = diag(0, nrow = length(x))
  dimnames(distances) = list(names(x), names(x))
  for (i in 2:length(x))  for (j in 1:(i-1))  {
    distances[i, j] = distances[j, i] = jeffreys(x[[i]], x[[j]])
  }
  as.dist(distances)
}

Try the dad package in your browser

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

dad documentation built on Aug. 30, 2023, 5:06 p.m.