# NOT RUN {
## use iris data
data(iris)
X = as.matrix(iris[,1:4])
lab = as.factor(iris[,5])
## 1. use centered data
output1 <- do.fa(X,ndim=2)
## 2. use decorrelated data
output2 <- do.fa(X,ndim=2,preprocess="decorrelate")
## 3. use whitened data
output3 <- do.fa(X,ndim=2,preprocess="whiten")
## Visualize three different projections
opar <- par(no.readonly=TRUE)
par(mfrow=c(3,1))
plot(output1$Y, col=lab, main="FA::centered")
plot(output2$Y, col=lab, main="FA::decorrelated")
plot(output3$Y, col=lab, main="FA::whitened")
par(opar)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab