From ravi.varadhan at jhu.edu  Fri May 30 14:33:25 2014
From: ravi.varadhan at jhu.edu (Ravi Varadhan)
Date: Fri, 30 May 2014 12:33:25 +0000
Subject: [Rd] A bug in princomp(), perhaps?
In-Reply-To: <5213E16E-54FC-46D2-A92E-BC2D44A338BD@gmail.com>
References: <2F9EA67EF9AE1C48A147CB41BE2E15C30E2D6CDC@DOM-EB-MAIL2.win.ad.jhu.edu>
	<5213E16E-54FC-46D2-A92E-BC2D44A338BD@gmail.com>
Message-ID: <2F9EA67EF9AE1C48A147CB41BE2E15C30E2D7237@DOM-EB-MAIL2.win.ad.jhu.edu>

Thank you, Peter.  Now I see that.  

I still think the documentation of `na.action' can be made more explicit to state that this option is only used for princomp.formula.

Best regards,
Ravi

-----Original Message-----
From: peter dalgaard [mailto:pdalgd at gmail.com] 
Sent: Friday, May 30, 2014 5:15 AM
To: Ravi Varadhan
Cc: r-devel at r-project.org
Subject: Re: [Rd] A bug in princomp(), perhaps?

It's only documented to work for princomp.formula; other methods do not know about na.action.

-pd

On 29 May 2014, at 22:10 , Ravi Varadhan <ravi.varadhan at jhu.edu> wrote:

> Hi,
> 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:
>> options("na.action")
> $na.action
> [1] "na.omit"
> 
> Thanks,
> Ravi
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] A bug in princomp(), perhaps?
Ravi Varadhan