Learn R Programming

largeVis (version 0.2.1.1)

buildEdgeMatrix: Build an nearest-neighbor graph weighted by distance.

Description

Build an nearest-neighbor graph weighted by distance.

Convert an edge matrix to a dist object.

Usage

buildEdgeMatrix(data, neighbors = NULL, distance_method = "Euclidean",
  threads = NULL, verbose = getOption("verbose", TRUE), ...)

# S3 method for edgematrix as.dist(m, diag = FALSE, upper = FALSE)

Arguments

data

A matrix with a number of columns equal to the number of columns in `x`

neighbors

An adjacency matrix of the type produced by randomProjectionTreeSearch. If NULL, randomProjectionTreeSearch will be run with parameters given by ....

distance_method

One of "Euclidean" or "Cosine"

threads

The number of threads to use in calculating distance; set automatically if NULL (the default).

verbose

Verbosity

...

Additional parameters passed to randomProjectionTreeSearch if neighbors is NULL.

m

An `edgematrix` object.

diag

logical value indicating whether the diagonal of the distance matrix should be printed by print.dist.

upper

logical value indicating whether the upper triangle of the distance matrix should be printed by print.dist.

Value

An `edgematrix` object consisting of the elements of a sparse matrix, with the distance method stored in attribute method.

A dist object.