I'm trying to plot the robust principal components with prcomp.robust but don't work; however, if I just use the prcomp function it works.
The error message is below:
robust2 <- prcomp.robust(iris[, 1:4], robust="MCD")
autoplot(robust2, data = iris, colour = 'Species')
Error in
[.data.frame
(plot.data, , c(x.column, y.column)): undefined columns selected Traceback:1. autoplot(robust2, data = iris, colour = "Species", shape = FALSE, . label.size = 6, loadings = TRUE, loadings.label = TRUE, loadings.label.size = 5, . loadings.colour = "black", loadings.label.colour = "red")2. autoplot.prcomp(robust2, data = iris, colour = "Species", shape = FALSE, . label.size = 6, loadings = TRUE, loadings.label = TRUE, loadings.label.size = 5, . loadings.colour = "black", loadings.label.colour = "red")3. t(t(plot.data[, c(x.column, y.column)])/lam)4. t(plot.data[, c(x.column, y.column)])5. plot.data[, c(x.column, y.column)]6.[.data.frame
(plot.data, , c(x.column, y.column))7. stop("undefined columns selected")