dist_wrt: Compute Distances with respect to a certain Point

Description Usage Arguments Value Examples

View source: R/svs.r

Description

A function for computing (euclidean) distances with respect to a certain specified point.

Usage

1
dist_wrt(x, wrt = NULL)

Arguments

x

A numeric matrix (containing coordinates).

wrt

A specification of the point with respect to which to compute all distances: can be either a vector or the character label of one of the row levels in x. If NULL or NA, then the origin (i.e. the point c(0 , 0, 0,... )) is taken as the value.

Value

A matrix (containing distances between the rows of x and wrt).

Examples

1
2
3
4
5
SndT_Fra <- read.table(system.file("extdata", "SndT_Fra.txt", package = "svs"),
   header = TRUE, sep = "\t", quote = "\"", encoding = "UTF-8",
   stringsAsFactors = FALSE)
sca.SndT_Fra <- fast_sca(SndT_Fra)
dist_wrt(sca.SndT_Fra$pos1, wrt = "beginnen")

svs documentation built on Nov. 10, 2020, 1:09 a.m.