#' Distance Matrix Computation
#'
#' Adds the ability to compute the Khi2 distance between the rows of a matrix to
#' the stats::dist function. Computation is done in C++ via Rcpp.
#'
#' @param L matrix, data.frame
#' @param method character
#'
#' @return matrix, data.frame, dist
#'
#' @export
dist <- function(L, method = "khi2") {
if (method == "khi2") {
D <- dist_khi2_cpp(L)
} else {
D <- stats::dist(L, method)
}
D
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.