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

Description Usage Arguments Value Note

View source: R/buildEdgeMatrix.R

Description

Build an nearest-neighbor graph weighted by distance.

Convert an edge matrix to a dist object.

Usage

1
2
3
4
5
buildEdgeMatrix(data, neighbors = NULL, distance_method = "Euclidean",
  threads = NULL, verbose = getOption("verbose", TRUE), ...)

## S3 method for class '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.

Note

This method converts the otherwise sparse edge matrix into a dense dist object, where any distances absent from the edge matrix are represented as NA.


largeVis documentation built on Feb. 17, 2018, 1:01 a.m.