[Rd] A bug in princomp(), perhaps?
pdalgd at gmail.com
Fri May 30 11:14:34 CEST 2014
It's only documented to work for princomp.formula; other methods do not know about na.action.
On 29 May 2014, at 22:10 , Ravi Varadhan <ravi.varadhan at jhu.edu> wrote:
> It may be my misunderstanding, but it seems that the "na.action" in the princomp() function for principal components analysis does not work. Please see this simple example:
> u <- matrix(rnorm(75), ncol=1)
> v <- matrix(rnorm(20), ncol=1)
> x <- u%*%t(v) + matrix(rnorm(20*75),ncol=20)
> x[1,1] <- NA
> pc.out <- princomp(x, na.action=na.exclude)
> Error in cov.wt(z) : 'x' must contain finite values only
> Note, I have:
>  "na.omit"
> [[alternative HTML version deleted]]
> R-devel at r-project.org mailing list
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
More information about the R-devel