## EXAMPLE 1: rips diagram for circles (euclidean distance)
XX = circleUnif(30)
maxscale=5
maxdimension=1
## note that the input XX is a point cloud
Diag=ripsDiag(XX,maxdimension,maxscale, printProgress=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)
maxscale=5
maxdimension=1
## note that the input distXX is a distance matrix
DiagTri=ripsDiag(distX,maxdimension,maxscale, dist="arbitrary", printProgress=TRUE)
#points with lifetime=0 are not shown. e.g. the loop of the triangle.
print(DiagTri$diagram)
Run the code above in your browser using DataLab