Skip to content
Prev 9064 / 398503 Next

math expressions

Don Wingate wrote:
This won't work:

  names <- c(x1^2, x2^2)
Error: Object "x1" not found

1. You can set "x1^2" in quotes, to make this assignment work.
2. It is a bad idea to call the vector "names", because it's already a
function.

What you could better do is:

  my.names <- expression(x[1]^2, x[2]^2)
  dotplot(1:2, labels = my.names)
Uwe Ligges
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._