sdists.center: Centroid Sequences

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/sdists.util.R

Description

Find centroid sequences among a collection of sequences.

Usage

1
2
3
sdists.center(x, d = NULL, method = "ow", weight = c(1, 1, 0, 2),
              exclude = c(NA, NaN, Inf, -Inf), FUN = NULL, ...,
              unique = FALSE)

Arguments

x

a list (of vectors) of a vector of character.

d

a matrix or an object of class dist.

method

argument to sdists.

weight

argument to sdists.

exclude

argument to sdists.

FUN

a function to rank distances.

...

additional arguments to FUN.

unique

a logical specifying whether to return a unique set of sequences.

Details

This function provides a wrapper to computing the distances among the sequences in x, unless d is supplied, and the subsequent selection of a set of centroid sequences with minimum sum of distances to any other sequence.

Value

A subset of x.

Author(s)

Christian Buchta

See Also

sdists for distance computation.

Examples

1
2
x <- c("ABCD", "AD", "BCD", "ACF", "CDF", "BC")
sdists.center(x)

Example output

Loading required package: grid
Loading required package: proxy

Attaching package: 'proxy'

The following objects are masked from 'package:stats':

    as.dist, dist

The following object is masked from 'package:base':

    as.matrix

[1] "ABCD" "BCD" 

cba documentation built on May 2, 2019, 1:39 p.m.

Related to sdists.center in cba...