Re: [Rd] `[` not recognized as a primitive in certain cases.

2017-03-29 Thread Martin Maechler
> Joris Meys > on Tue, 28 Mar 2017 15:19:14 +0200 writes: > Thank you gents, I overlooked the subtle differences. > On Tue, Mar 28, 2017 at 2:49 PM, Lukas Stadler > wrote: >> “typeof” is your friend here: >>

Re: [Rd] `[` not recognized as a primitive in certain cases.

2017-03-28 Thread Joris Meys
Thank you gents, I overlooked the subtle differences. On Tue, Mar 28, 2017 at 2:49 PM, Lukas Stadler wrote: > “typeof” is your friend here: > > > typeof(`[`) > [1] "special" > > typeof(mc[[1]]) > [1] "symbol" > > typeof(mc2[[1]]) > [1] "special" > > so mc[[1]] is a

Re: [Rd] `[` not recognized as a primitive in certain cases.

2017-03-28 Thread Lukas Stadler
“typeof” is your friend here: > typeof(`[`) [1] "special" > typeof(mc[[1]]) [1] "symbol" > typeof(mc2[[1]]) [1] "special" so mc[[1]] is a symbol, and thus not a primitive. - Lukas > On 28 Mar 2017, at 14:46, Michael Lawrence wrote: > > There is a difference between

Re: [Rd] `[` not recognized as a primitive in certain cases.

2017-03-28 Thread Michael Lawrence
There is a difference between the symbol and the function (primitive or closure) to which it is bound. This: mc2 <- as.call(list(`[`,iris,2,"Species")) Evaluates `[` to its value, in this case the primitive object, and the primitive itself is incorporated into the returned call. If you were to

[Rd] `[` not recognized as a primitive in certain cases.

2017-03-28 Thread Joris Meys
Dear, I have noticed this problem while looking at the following question on Stackoverflow : http://stackoverflow.com/questions/42894213/s4-class-subset-inheritance-with-additional-arguments While going through callNextMethod, I've noticed the following odd behaviour: mc <-