Description Usage Arguments Value Examples
Construct a weighted graph adjacency matrix
1 2 3 4 |
x |
The feature-by-sample (e.g. genes are rows, cells are columns) data matrix |
kernel |
The choice of kernel. 'nn' will give nearest neighbours, 'dist' gives minimum distance and 'heat' gives a heat kernel. Discussed in detail in 'Laplacian Eigenmaps and Spectral Techniques for Embedding and Clustering', Belkin & Niyogi |
metric |
The metric with which to assess 'closeness' for nearest neighbour selection, one of 'correlation' (pearson) or 'euclidean'. Default is 'correlation'. |
nn |
Number of nearest neighbours if kernel == 'nn' |
eps |
Maximum distance parameter if kernel == 'dist' |
t |
'time' for heat kernel if kernel == 'heat' |
symmetrize |
How to make the adjacency matrix symmetric. Note that slightly counterintuitively, node i having node j as a nearest neighbour doesn't guarantee node j has node i. There are several ways to get round this:
|
An n by n adjacency matrix
1 2 | x <- matrix(rnorm(50), ncol = 10) # synthetic data matrix
wg <- weighted_graph(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.