XX1 <- circleUnif(30)
XX2 <- circleUnif(30, r = 2) + 3
XX <- rbind(XX1, XX2)
DiagLim <- 5
maxdimension <- 1
## rips diagram
Diag <- ripsDiag(XX, maxdimension, DiagLim, printProgress = TRUE)
#plot
par(mfrow = c(1, 3))
plot(Diag[["diagram"]])
plot(Diag[["diagram"]], rotated = TRUE)
plot(Diag[["diagram"]], barcode = TRUE)
Run the code above in your browser using DataLab