From bbolker at gmail.com  Tue Jun  3 02:07:28 2014
From: bbolker at gmail.com (Ben Bolker)
Date: Tue, 3 Jun 2014 00:07:28 +0000
Subject: [Rd] A bug in princomp(), perhaps?
References: <2F9EA67EF9AE1C48A147CB41BE2E15C30E2D6CDC@DOM-EB-MAIL2.win.ad.jhu.edu>
	<5213E16E-54FC-46D2-A92E-BC2D44A338BD@gmail.com>
	<2F9EA67EF9AE1C48A147CB41BE2E15C30E2D7237@DOM-EB-MAIL2.win.ad.jhu.edu>
	<CAAHES9zWN3c4pdK8XcKLuKbq4kNV3Ohs6NCb0yo9dGM0+3sP4w@mail.gmail.com>
	<2F9EA67EF9AE1C48A147CB41BE2E15C30E2D734D@DOM-EB-MAIL2.win.ad.jhu.edu>
	<CAAHES9xiwaSv3FQ1HYY3NPfCsdqGN+fvqDzvp6vxtArERXA4Jw@mail.gmail.com>
	<loom.20140531T202439-171@post.gmane.org>
Message-ID: <loom.20140603T020140-313@post.gmane.org>

Ben Bolker <bbolker <at> gmail.com> writes:

> 
> FWIW this seems to be a FAQ:
> 
> https://stat.ethz.ch/pipermail/r-devel/2003-July/027018.html
> 
> http://thr3ads.net/r-devel/2013/01/
>    2171832-Re-na.omit-option-in-prcomp-formula-interface-only
> 
> http://r.789695.n4.nabble.com/
>   na-omit-option-in-prcomp-formula-interface-only-td4373533.html
> 
> And two StackOverflow questions (the latter's a bit tangential):
> 
> http://stackoverflow.com/questions/12078291/
>    r-function-prcomp-fails-with-nas-values-even-though-nas-are-allowed
> 
> http://stackoverflow.com/questions/23421438/
>   what-was-wrong-with-running-princomp-in-r/23446938#23446938
> 
>   (Sorry for broken URLs and random assortment of mailing list
> aggregators.)
> 
>   I appreciate Gavin's points that implementing this stuff for
> princomp.default is difficult/problematic, but I second Ravi's
> request for a little  more clarification in the help  text; it's
> quite easy to miss the fact that 'na.action' is defined for
> princomp.formula but not for princomp.default.  Perhaps just
> "Note that setting na.action works for princomp.formula, but
> not for princomp.default" (under the "na.action" argument description).

Putting my effort where my mouth is: I wonder if there is any chance
that this patch against the current SVN would be accepted ... ??

Index: princomp.Rd
===================================================================
--- princomp.Rd	(revision 65832)
+++ princomp.Rd	(working copy)
@@ -37,7 +37,8 @@
     when the data contain \code{NA}s.  The default is set by
     the \code{na.action} setting of \code{\link{options}}, and is
     \code{\link{na.fail}} if that is unset. The \sQuote{factory-fresh}
-    default is \code{\link{na.omit}}.}
+    default is \code{\link{na.omit}}.  (This argument applies \emph{only}
+    to the formula method.)}
   \item{x}{a numeric matrix or data frame which provides the data for the
     principal components analysis.}
   \item{cor}{a logical value indicating whether the calculation should
Index: prcomp.Rd
===================================================================
--- prcomp.Rd	(revision 65832)
+++ prcomp.Rd	(working copy)
@@ -40,7 +40,8 @@
     when the data contain \code{NA}s.  The default is set by
     the \code{na.action} setting of \code{\link{options}}, and is
     \code{\link{na.fail}} if that is unset. The \sQuote{factory-fresh}
-    default is \code{\link{na.omit}}.}
+    default is \code{\link{na.omit}}. (This argument applies \emph{only}
+    to the formula method.)}
   \item{\dots}{arguments passed to or from other methods. If \code{x} is
     a formula one might specify \code{scale.} or \code{tol}.}
   \item{x}{a numeric or complex matrix (or data frame) which provides



[Rd] A bug in princomp(), perhaps?
Ben Bolker