# NOT RUN {
## load iris data
data(iris)
X = as.matrix(iris[,1:4])
lab = as.factor(iris[,5])
## compare two potential distances with PCA
pca2d <- do.pca(X, ndim=2)
phlog <- do.phate(X, ndim=2, dtype="log")
phsqt <- do.phate(X, ndim=2, dtype="sqrt")
## Visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3))
plot(pca2d$Y, col=lab, pch=19, main="PCA")
plot(phlog$Y, col=lab, pch=19, main="log potential")
plot(phsqt$Y, col=lab, pch=19, main="sqrt potential")
par(opar)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab