Re: [R] make methods work in lapply - remove lapply's environment

2008-09-09 Thread Prof Brian Ripley
This is a side-effect of lapply being in the base namespace and not evaluating its arguments, as explained on its help page which also points out that using a wrapper is sometimes needed. It also points out that code has been written that relies on the current behaviour. On Mon, 8 Sep 2008,

[R] make methods work in lapply - remove lapply's environment

2008-09-08 Thread Tim Hesterberg
I've defined my own version of summary.default, that gives a better summary for highly skewed vectors. If I call summary(x) the method is used. If I call summary(data.frame(x)) the method is not used. I've traced this to lapply; this uses the new method: lapply(list(x), function(x)

Re: [R] make methods work in lapply - remove lapply's environment

2008-09-08 Thread Duncan Murdoch
On 08/09/2008 9:37 PM, Tim Hesterberg wrote: I've defined my own version of summary.default, that gives a better summary for highly skewed vectors. If I call summary(x) the method is used. If I call summary(data.frame(x)) the method is not used. I've traced this to lapply; this uses the