path <- cbind(1:100,exp(-(1:100-50)^2/80))
path2 <- SimplifyPath(path)
<!-- %Don't run the following to avoid long package build times/large package file. -->
## Not run: ------------------------------------
# plot(path)
# plot(path2)
# plot(path)
# points(SimplifyPath(path,tolerance=.1),type="o",
# col="red",cex=1.2,lwd=2)
# plot(path)
# points(SimplifyPath(path,tolerance=.01,plot=TRUE),type="o",
# col="red",cex=1.2,lwd=2)
# plot(path)
# points(SimplifyPath(path,tolerance=.005,plot=TRUE),type="o",
# col="red",cex=1.2,lwd=2)
## ---------------------------------------------
Run the code above in your browser using DataLab