R/SeqDistribution.R

Defines functions SeqDistribution

Documented in SeqDistribution

#' Calculates distances in N! space.
#' 
#' Calculates Kendall's distances of each sequence in N! space.  This is VERY
#' Inefficient for N >= 8.  See DistanceDistribution for an astronomical
#' improvement (possibly on the order of 10^10).
#' 
#' 
#' @param N Length of the ranking.  Preferrably less than 9.
#' @return Vector of Kendall distances from 1:N to each sequence in N! space.
#' @author Erik Gregory
#' @keywords distance bubblesort

SeqDistribution <-
function(N) {
  seqs <- do.call("rbind", permn(N))
  all.dists <- AllSeqDists(seqs)
  return(all.dists)
}

Try the RMallow package in your browser

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

RMallow documentation built on Feb. 7, 2020, 9:06 a.m.