Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

partialDist

Partial distance matrix (focus on closest)


Description

partialDist calculates distance matrix like dist for 1- or 2-dim data, but only partially, ie only cases of small distances. This function was made for treating very large data-sets where only very close distances to a given point need to be found, it allows to overcome memory-problems with larger data (and faster execution with > 50 rows of 'dat').

Usage

partialDist(
  dat,
  groups,
  overLap = TRUE,
  method = "euclidean",
  silent = FALSE,
  callFrom = NULL
)

Arguments

dat

(matrix of numeric values) main input

groups

(factor) to split using cut or specific custom grouping (length of dat)

overLap

(logical) if TRUE make groups overlapping by 1 value (ie maintain some context-information)

method

'character' name of method passed to dist

silent

(logical) suppres messages

callFrom

(character) allow easier tracking of message(s) produced

Value

matrix (not of class 'dist')

See Also

Examples

set.seed(2016); mat3 <- matrix(runif(300),nr=30)
round(dist(mat3),1)
round(partialDist(mat3,gr=3),1)

wrMisc

Analyze Experimental High-Throughput (Omics) Data

v1.5.4
GPL-3
Authors
Wolfgang Raffelsberger [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.