s.distance {ldt}R Documentation

Get the Distances Between Variables

Description

This function calculates the distances between the columns of a numeric matrix.

Usage

s.distance(
  data,
  distance = "correlation",
  correlation = "pearson",
  checkNan = TRUE
)

Arguments

data

A numeric matrix with variables in the columns.

distance

Character string specifying the type of distance. It can be correlation, absCorrelation, euclidean, manhattan, or maximum.

correlation

Character string specifying the type of correlation if distance is correlation. It can be pearson or spearman.

checkNan

Logical value indicating whether to check for NAs (and omit them if any exist).

Details

The main purpose of exporting this statistics helper method is to show the inner calculations of the package.

Value

A symmetric matrix (lower triangle as a vector).

Examples

n <- 10
data <- data.frame(x = rnorm(n), y = rnorm(n), z = rnorm(n))
distances <- s.distance(data)


[Package ldt version 0.5.3 Index]