Learn R Programming

topolow (version 1.0.0)

analyze_network_structure: Calculate Network Analysis Metrics

Description

Analyzes the connectivity pattern in a distance matrix by converting it to a network representation. Useful for assessing data completeness and structure.

Usage

analyze_network_structure(distance_matrix)

Value

A list containing the network analysis results:

adjacency

A logical matrix where TRUE indicates a measured distance between two points, representing the network's adjacency matrix.

connectivity

A data.frame with node-level metrics, including the completeness (degree) for each point.

summary

A list of overall network statistics, including n_points, n_measurements, and total completeness.

Arguments

distance_matrix

Square symmetric matrix of distances

Examples

Run this code
# Create a sample distance matrix
dist_mat <- matrix(runif(25), 5, 5)
# Add row and column names
rownames(dist_mat) <- colnames(dist_mat) <- paste0("Point", 1:5)
dist_mat[lower.tri(dist_mat)] <- t(dist_mat)[lower.tri(dist_mat)]
diag(dist_mat) <- 0
dist_mat[1, 3] <- NA; dist_mat[3, 1] <- NA

# Analyze the network structure
metrics <- analyze_network_structure(dist_mat)
print(metrics$summary$completeness)

Run the code above in your browser using DataLab