[Rd] eapply weirdness/bug

From: <Mark.Bravington_at_csiro.au>
Date: Fri 18 Feb 2005 - 14:38:09 EST


The following looks like an 'eapply' bug to me:

t/subtest> e <- new.env()
t/subtest> e$tempo <- quote( 1+'hi')

t/subtest> lapply( ls( e), function( x) length( get( x,e)))
[[1]]
[1] 3

# seems reasonable-- e$tempo is a 'call' object of length 3

t/subtest> eapply( e, length)
Error in 1 + "hi" : non-numeric argument to binary operator

t/subtest> eapply( e, length)
t/subtest> traceback()

1: eapply(e, length)

For some reason 'eapply' seems to *evaluate* objects of mode 'call' (it happened with every call-mode object I tried). This shouldn't happen-- or should it?

Mark

Mark Bravington
CSIRO Mathematical & Information Sciences Marine Laboratory
Castray Esplanade
Hobart 7001
TAS ph (+61) 3 6232 5118
fax (+61) 3 6232 5012
mob (+61) 438 315 623

        [[alternative HTML version deleted]]



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri Feb 18 13:44:01 2005

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:02:53 EST