I'm trying to use psych to perform factor analysis and create a biplot in which points are coloured by grouping variable.
I want the biplot to group by colour and only plot points not group labels.
Documentation suggests passing labels = NULL
will plot points using character supplied by pch
. However, doing so reduces the plot to only the first group (setosa).
Perhaps I am misunderstanding the group
argument? Your help is appreciated.
Example:
library(psych)
data(iris)
iris_fa <- fa(iris[,-5],
nfactors = 2)
biplot.psych(iris_fa,
labels=iris[,5],
choose = c(1,2),
pch=16,
group = iris[,5])
I
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.