R/chiDist2.R

Defines functions chiDist2

Documented in chiDist2

chiDist2 <- function(A){
    # Calculates the pairwise chi-square distance between all rows in a given matrix.
    # Uses chi2Dist from 'ExPosition' package
    #
    # Args:
    #   A: Matrix with rows representing samples
    # 
    # Returns:
    #   D: NxN matrix where N is the number of rows in A. Element i,j in 
    #       the returned matrix is the chi-square distance between A[i,]
    #        and A[j,].

    return(chi2Dist(A)$D)
}

Try the SNFtool package in your browser

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

SNFtool documentation built on June 11, 2021, 9:06 a.m.