XX1 = circleUnif(30)
XX2 = circleUnif(30, r=2) +3
XX=rbind(XX1,XX2)
DiagLim=5
maxdimension=1
## note that the input XX is a point cloud
Diag=ripsDiag(XX,maxdimension,DiagLim, printStatus=TRUE)
#persistence silhouette
tseq=seq(0,DiagLim, length=1000)
Sil=silhouette(Diag, p=1, dimension=1, tseq)
plot(tseq, Sil, type="l", xlab="t", ylab="silhouette", asp=1)
Run the code above in your browser using DataLab