# NOT RUN {
## use iris data
data(iris)
set.seed(100)
subid = sample(1:150,50)
X = as.matrix(iris[subid,1:4])
lab = as.factor(iris[subid,5])
## use 10% and 25% of the data and compare with full MDS
output1 <- do.lmds(X,npoints=round(nrow(X)*0.10))
output2 <- do.lmds(X,npoints=round(nrow(X)*0.25))
output3 <- do.mds(X,ndim=2)
## vsualization
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3))
plot(output1$Y, pch=19, col=lab, main="10% random points")
plot(output2$Y, pch=19, col=lab, main="25% random points")
plot(output3$Y, pch=19, col=lab, main="original MDS")
par(opar)
# }
Run the code above in your browser using DataLab