function vectors (was [R]..... lists of expressions)

Martin Maechler maechler at stat.math.ethz.ch
Mon Apr 26 18:47:51 CEST 2004


>>>>> "Tamas" == Tamas Papp <tpapp at axelero.hu>
>>>>>     on Mon, 26 Apr 2004 18:26:25 +0200 writes:

    Tamas> On Mon, Apr 26, 2004 at 07:50:07AM -0700, Thomas Lumley wrote:
    >> An expression is already a vector in this sense
    >> eg
    >> plot(1:10)
    >> text(c(4,2),c(2,4),labels=expression(a[1],b[2]))

    Tamas> Thanks (also to Deepayan Sarkar), now I see.  I have found
    Tamas> ?character-class, and now I see that vectors can have a mode of
    Tamas> "expression", too.

    Tamas> Another (related) question: why aren't there vectors of
    Tamas> mode="function" in R?  Are they difficult to implement, not needed,
    Tamas> etc., what is the reason for their abscence?  I found that I can make
    Tamas> a vector of functions by using expression and then eval, so there is a
    Tamas> workaround, but I am just curious about this.

since  lists of functions are easy enough to handle,
(and they *are* ``vectors'' (though not atomic ones) on the
 C-level of R).


    Tamas> Thanks,

You're welcome.
Martin




More information about the R-help mailing list