[Rd] na.omit option in prcomp: formula interface only

From: Ben Bolker <bbolker_at_gmail.com>
Date: Thu, 09 Feb 2012 11:45:52 -0500

  This is a wishlist/request for discussion about the behaviour of the na.action option in prcomp, specifically the fact that it only applies to the formula interface.

   I had a question from a friend (who is smart and careful and generally R's TFM, although like all of us he misses things sometimes) asking why the na.action= argument didn't seem to be doing anything in prcomp (i.e. one gets an "Error in svd(x, nu=0): infinite or missing values in 'x'"). Some poking later, I realized that na.action only applied to the formula interface (so I told him to try prcomp(~.,data=x,...) instead). Sufficiently careful reading of the help page, with hindsight, revealed that na.action only appears in the arguments for the formula method, not the default (on the other hand,

'scale.' only appears in the default formula, but it *does* work with
prcomp.formula as well, because prcomp.formula passes ... through to
prcomp.default ...)

  Would it be reasonable to (at least) add a sentence to the documentation saying that na.action applies only to the formula interface or (possibly) to add some NA-processing machinery to prcomp.default to allow it to handle na.action as well? (I can appreciate from looking at stats:::prcomp.formula that the NA-processing is not completely trivial ...)

  Ben Bolker



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 09 Feb 2012 - 17:07:10 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 10 Feb 2012 - 12:30:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive