View source: R/enclosing_rad.R
enclosing_radius | R Documentation |
The enclosing radius is the minimum (Euclidean distance) radius beyond which no topological changes will occur.
enclosing_radius(X, distance_mat = FALSE)
X |
the input dataset, must either be a matrix or data frame. |
distance_mat |
whether or not 'X' is a distance matrix, default FALSE. |
the numeric enclosing radius.
Shael Brown - shaelebrown@gmail.com
# create a persistence diagram from a 2D Gaussian
df = data.frame(x = rnorm(n = 20,mean = 0,sd = 1),y = rnorm(n = 20,mean = 0,sd = 1))
# compute the enclosing radius from the point cloud
enc_rad <- enclosing_radius(df, distance_mat = FALSE)
# compute the distance matrix manually, stored as a matrix
dist_df <- as.matrix(dist(df))
# compute the enclosing radius from the distance matrix
enc_rad <- enclosing_radius(dist_df, distance_mat = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.