On Wed, Sep 30, 2009 at 8:41 AM, Peter <rpy-l...@maubp.freeserve.co.uk> wrote:
> Can you do something like check if example_name is a valid argument
> for the function at run time, and if not, check example.name instead?
> Would this impose too high a performance cost?

Unfortunately, there is no reliable way to work out what arguments an
R function expects. You can poke around in the parse tree to find its
declared argument list, but many many R functions play wacky games
with "...", match.call, etc. So you can figure it out in many cases,
but not all.

That's why I like the approach where we just always convert _'s into
.'s. Like any approach, it will be wrong sometimes. But it will be
*predictably* wrong -- I can just look at the R docs, and know that if
they have an underscore then I need to use rcall. I can't necessarily
tell when a magic source inspection tool will get things wrong without
doing my own source inspection, and I don't want to have to do source
inspection every time I call an R function.

-- Nathaniel

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to