| cubical | R Documentation |
This function is an R wrapper for the CubicalRipser C++ library to calculate
persistent homology. For more information on the C++ library, see
https://github.com/CubicalRipser. For more information on how objects of
different classes are evaluated by cubical, read the Details section
below.
cubical(dataset, ...)
## S3 method for class 'array'
cubical(dataset, threshold = 9999, method = "lj", ...)
## S3 method for class 'matrix'
cubical(dataset, ...)
dataset |
object on which to calculate persistent homology |
... |
other relevant parameters |
threshold |
maximum simplicial complex diameter to explore |
method |
either |
cubical.array assumes dataset is a lattice, with each element containing
the value of the lattice at the point represented by the indices of the
element in the array.
cubical.matrix is redundant for versions of R at or after 4.0. For
previous versions of R, in which objects with class matrix do not
necessarily also have class array, dataset is converted to an array
and persistent homology is then calculated using cubical.array.
PHom object
# 2-dim example
dataset <- rnorm(10 ^ 2)
dim(dataset) <- rep(10, 2)
cubical_hom2 <- cubical(dataset)
# 3-dim example
dataset <- rnorm(8 ^ 3)
dim(dataset) <- rep(8, 3)
cubical_hom3 <- cubical(dataset)
# 4-dim example
dataset <- rnorm(5 ^ 4)
dim(dataset) <- rep(5, 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.