# NOT RUN {
## generate data of 3 types with clear difference
dt1 = aux.gensamples(n=33)-100
dt2 = aux.gensamples(n=33)
dt3 = aux.gensamples(n=33)+100
## merge the data and create a label correspondingly
X = rbind(dt1,dt2,dt3)
label = c(rep(1,33), rep(2,33), rep(3,33))
## try different neighborhood sizes
out1 = do.ldp(X, label, type=c("proportion",0.01))
out2 = do.ldp(X, label, type=c("proportion",0.05))
out3 = do.ldp(X, label, type=c("proportion",0.10))
## visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3))
plot(out1$Y, col=label, main="1% connectivity")
plot(out2$Y, col=label, main="5% connectivity")
plot(out3$Y, col=label, main="10% connectivity")
par(opar)
# }
Run the code above in your browser using DataLab