[R] text() does not handle lists of expressions

Tamas Papp tpapp at axelero.hu
Mon Apr 26 15:08:33 CEST 2004


Hi,

text() does not work for lists of expressions.  To demonstrate:

ee <- list(expression(b[1]), expression(b[2]))
plot(1:2, 1:2)
text(1.2,1.2,ee[[1]])                   # fine
text(1.2,1.8,ee[[2]])                   # fine
text(1.8,c(1.2,1.8),ee)                 # wrong

So I have to use a loop for that.  I cannot coerce lists of
expressions to vectors, so in this case, I cannot exploit the feature
of text() accepting x and y coordinates (and other things) as vectors.

I do not mean to say that this is a bug, it may simply be "unintended
behaviour", but it would be really nice if text() could handle lists.
Or is is there a way to have a vector of expressions that I am not
aware of?

Thanks,

Tamas

-- 
Tamás K. Papp
E-mail: tpapp at axelero.hu
Please try to send only (latin-2) plain text, not HTML or other garbage.




More information about the R-help mailing list