## EXAMPLE 1: rips diagram for circles (euclidean distance)
XX = circleUnif(30)
DiagLim=5
maxdimension=1
## note that the input XX is a point cloud
Diag=ripsDiag(XX,maxdimension,DiagLim, printStatus=TRUE)
## EXAMPLE 2: rips diagram with arbitrary distance
## distance matrix for triangle with edges of length: 1,2,4
distX=matrix(c(0,1,2,1,0,4,2,4,0), ncol=3)
#rips diagram using the distance matrix as input
DiagLim=5
maxdimension=1
## note that the input distXX is a distance matrix
DiagTri=ripsDiag(distX,maxdimension,DiagLim, dist="arbitrary", printStatus=TRUE)
#points with lifetime=0 are not shown. e.g. the loop of the triangle.
Run the code above in your browser using DataLab