Please read the help page: ## S3 method for class 'formula': prcomp(formula, data = NULL, subset, na.action, ...)
## Default S3 method: prcomp(x, retx = TRUE, center = TRUE, scale. = FALSE, tol = NULL, ...) So there is no na.action argument for the form you used, and your 'na.omit' matches 'retx'. Try prcomp(~ ., data=ot, na.action=na.omit, scale=TRUE) or prcomp(na.omit(ot), scale=TRUE) On Fri, 4 Jan 2008, Silvia Lomascolo wrote: > > Hi, > I am trying to do a PCA on my data but I keep getting the error message > > svd(x, nu=0) infinite or missing values > >> From the messages posted on the subject, I understand that the NAs in my > data might be the problem, but I thought na.omit would take care of that. > Less than 5% of my cells are missing data. However, the NAs are not > regularly distributed across my matrix: certain cases and variables have > most of the NAs in the data set. Might that be the problem? Any hints as to > how to resolve this without having to get rid of those cases and variables? > Code is pasted below. > > Any help is greatly appreciated! > > Silvia. > > CODE: > > ot = read.table('C:\\Documents and Settings\\...\\matrix.txt', header=T) > ot.pca = prcomp(ot, scale.=T, na.omit)#this is as far as I got. I have also > tried princomp but I get a very similar error message > > I use Windows, and R version 2.6.0. > -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 ______________________________________________ R-help@r-project.org mailing list 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.