On 2/4/07, Charilaos Skiadas <[EMAIL PROTECTED]> wrote: > Greetings, > > I have a problem that I am sure is very straightforward, but I just > can't wrap my head around it. I've read the help pages on text, > plotmath, expression, substitute, but somehow I can't find the answer > to this simple question. > > Basically consider the following example: > > plot( NULL, xlim = c(0,2), ylim = c(0,2) ) > expressions <- expression( -infinity, infinity ) > text( c(0.5,1.5), 1.5, expressions ) > labels <- c( "-infinity", "infinity" ) > text( c(0.5,1.5), 0.5, as.expression(labels) ) > > I want the character vector "labels" to be interpreted as an > expression vector, and so to appear just like the expressions vector. > Is this possible? I mean yes, it is probably possible, but how?
text( c(0.5,1.5), 0.5, parse(text=labels)) ? You need to parse the text to get to the expression Hadley ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
