[R] Using expression() in plot() XXXX

Dan Abner dan.abner99 at gmail.com
Mon May 7 23:39:16 CEST 2012


Hello everyone,

I am trying to add the following text (in proper notation) to a
graphic using expression().

X-bar (with a subscript of cv) = XX.

Note: Ideally "cv" would be a subscript, but it doesn't have to be.

 I have the following code:


> text(625,.012,expression(bar(X)cv = 552.01))
Error: unexpected symbol in "text(625,.012,expression(bar(X)cv"

I have also tried the following:

> text(625,.012,paste(as.character(expression(bar(X))),"cv = 552.01",sep=""))
>

While I get no error message for the later, it actually prints

bar(X)

instead of resolving to the proper notation.

Any assistance is appreciated.

Thanks!

Dan



More information about the R-help mailing list