powered by
This function calculates the distances between the columns of a numeric matrix.
s.distance( data, distance = "correlation", correlation = "pearson", checkNan = TRUE )
A symmetric matrix (lower triangle as a vector).
A numeric matrix with variables in the columns.
Character string specifying the type of distance. It can be correlation, absCorrelation, euclidean, manhattan, or maximum.
correlation
absCorrelation
euclidean
manhattan
maximum
Character string specifying the type of correlation if distance is correlation. It can be pearson or spearman.
distance
pearson
spearman
Logical value indicating whether to check for NAs (and omit them if any exist).
NA
The main purpose of exporting this statistics helper method is to show the inner calculations of the package.
n <- 10 data <- data.frame(x = rnorm(n), y = rnorm(n), z = rnorm(n)) distances <- s.distance(data)
Run the code above in your browser using DataLab