# NOT RUN {
## use iris data
data(iris)
X = as.matrix(iris[,1:4])
label = as.integer(iris$Species)
## copy a label and let 20% of elements be missing
nlabel = length(label)
nmissing = round(nlabel*0.20)
label_missing = label
label_missing[sample(1:nlabel, nmissing)]=NA
## compare true case with missing-label case
out1 = do.sda(X, label)
out2 = do.sda(X, label_missing)
## visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,2))
plot(out1$Y, col=label, main="true projection")
plot(out2$Y, col=label, main="20% missing labels")
par(opar)
# }
Run the code above in your browser using DataLab