species <- as.numeric(factor(iris[, "Species"]))
autoplot(prcomp(iris[, 1:4]), colour = species, environment = environment())
Warning message:
In if (value %in% columns) { :
the condition has length > 1 and only the first element will be used
Picking a column from the data frame works without a problem.
The legend is missing.
Picking a column from the data frame works without a problem.