Learn R Programming

motifcluster (version 0.2.3)

run_laplace_embedding: Run Laplace embedding

Description

Run Laplace embedding on a symmetric (weighted) adjacency matrix with a specified number of eigenvalues and eigenvectors.

Usage

run_laplace_embedding(adj_mat, num_eigs, type_lap = c("comb", "rw"))

Value

A list with two entries: vals contains the length-num_eigs vector of the first few eigenvalues of the Laplacian, and vects contains an nrow(adj_mat) by num_eigs matrix of the associated eigenvectors.

Arguments

adj_mat

Symmetric adjacency matrix to be embedded.

num_eigs

Number of eigenvalues and eigenvectors for the embedding.

type_lap

Type of Laplacian for the embedding. One of "comb" (combinatorial) or "rw" (random-walk).

Examples

Run this code
adj_mat <- matrix(c(1:9), nrow = 3)
run_laplace_embedding(adj_mat, 2, "rw")

Run the code above in your browser using DataLab