library("TDA") S = sphereUnif(300, 2, 1) T = torusUnif(300, 1, 2) # plot data library(rgl) open3d() plot3d(S[,1], S[,2], S[,3], size=4) open3d() plot3d(T[,1], T[,2], T[,3], size=4) # compute Rips filtration + diagram for sphere Diag1 <- ripsDiag(S, maxdimension = 2, maxscale = 1, library = "GUDHI", printProgress = TRUE) dev.new() plot(Diag1[["diagram"]]) # compute Rips filtration + diagram for torus Diag2 <- ripsDiag(T, maxdimension = 2, maxscale = 2, library = "GUDHI", printProgress = TRUE) dev.new() plot(Diag2[["diagram"]])