Dear R users,
I have a txt file named 'data_1.txt' whose first column contains the names
of the individuals and the other columns contain the values of four
variables X_1,X_2,X_3 and X_4. I read it with R from its location and
called it data. I'd like to do a normalized principal component analysis. I
started by calculating the correlation matrix:
cor(data)
I got the following message:
Error in cor(nnotes) : 'x' must be numeric.
I eliminated the first column of names, then read the modified data and
then added the names of individuals with rownames. I was able to run PCA
and obtain graphical representations of the variables, their coordinates,
contributions and cos2. However, when I used fviz_pca_ind to get the
graphical representation of the individuals, I got a graphic that considers
the variables as individuals. Can you please help me? I have attached the
file data_1 .txt file.
Many thanks in advance.
Name X_1 X_2 X_3 X_4
John 10.2 10 6 5
Ricardo 14.75 13.5 10.5 9
Suzane 17.75 16.5 12.5 10
Monica 15 14 13 9
Meriam 16 19 14 13
Philipps 17.75 17 12 12
Sonia 20 17 13 14
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.