[Rd] vapply definition question

Mick Jordan mick.jordan at oracle.com
Wed Dec 17 18:17:29 CET 2014


On 12/16/14, 9:54 PM, Martin Morgan wrote:
> Hi Mick --
>
> You can see that the source code doesn't contain '...' in the final line
>
> ~/src/R-devel/src/library/base/R$ svn annotate lapply.R | grep 
> Internal\(l
>  38631     ripley     .Internal(lapply(X, FUN))
>
> and that it's been there for a long time (I'd guess 'forever')
>
> ~/src/R-devel/src/library/base/R$ svn log -r38631
> ------------------------------------------------------------------------
> r38631 | ripley | 2006-07-17 14:30:55 -0700 (Mon, 17 Jul 2006) | 2 lines
>
> another attempt at a faster lapply
>
> ------------------------------------------------------------------------
>
> so I guess you're looking at a modified version of the function... The 
> implementation detail is in the comment -- FUN(X[i], ...) is evaluated 
> in the frame of lapply.
>
Oh dear, my apologies. It seems that, indeed, we had modified lapply.R 
(and sapply.R) to add the "...". Ironic in that I am going through the 
base code and trying to remove all the changes that we made as our 
implementation was developing, and somehow I missed that one. It's a 
minor nuisance to have to special case the "..." not being passed, but 
we can work around it.

Thanks
Mick



More information about the R-devel mailing list