[R] Help on Principal Component Analysis in R

Karim Mezhoud kmezhoud at gmail.com
Wed Jan 14 06:49:27 CET 2015

Hi error message indicates that you have non numeric value in your table/
matrix. Replace missing value by NA and add na.rm= true in your command
Le 14 janv. 2015 00:27, "R Help!" <emanekaf5 at gmail.com> a écrit :

> Hello!
> I am a beginner to R. I have read several guides, but still am stuck on
> this:
> I have data in an excel csv file, on which I want to run PCA.
> I'm not sure how the prcomp formula works. The help page states:
> prcomp(x, retx = TRUE, center = TRUE, scale. = FALSE,
> tol = NULL, ...)
> what is x referring to? I tried putting the file name for x, but i get the
> following error:
> Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric
> what kind of numeric value do I need to put in for x?
> Potentially helpful information: my data sheet has around 48 columns and
> over 7000 rows. I have converted the csv file into a matrix in R.
> Thanks in advance for all your help.
> I'd appreciate step by step instructions on how to go from my csv file to a
> PCA biplot in R.
>         [[alternative HTML version deleted]]
> ______________________________________________
> R-help at 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.

	[[alternative HTML version deleted]]

More information about the R-help mailing list