[R] characters, mathematical expressions and computed values

1Rnwb sbpurohit at gmail.com
Thu Oct 11 23:32:28 CEST 2012


Hello,

I have to add "Age (bar(x)=14.3) as a title on a chart. I am unable to get
this to working. I have tried bquote, substitute and expression, but they
are only doing a part of the job.

new<-
c(14.3, 18.5, 18.1, 17.7, 18, 15.9, 19.6, 17.3, 17.8, 17.5, 15.4, 
16.3, 15, 17.1, 17.1, 16.4, 15.2, 16.7, 16.7, 16.9, 14.5, 16.6, 
15.8, 15.2, 16.2, 15.6, 15, 17.1, 16.7, 15.6, 15, 15.8, 16.8, 
17, 15.2, 15.8, 15.7, 14.7, 17.3, 14.9, 16.8, 14.6, 19.3, 15.3, 
14.7, 13.3, 16.5, 16, 14.2, 16.1, 15.2, 13.4, 17.7, 15.5, 14.5, 
15.7, 13.6, 14.1, 20, 17.2, 16.5, 14.3, 13.7, 14.7, 15.4, 13.6, 
17, 17.3, 15.4, 15.5, 16.6, 15.8, 15.7, 14.7, 14.2, 14.2, 14, 
14.2, 19.1, 17.2, 18.3, 13.9, 16, 15.9, 14.9, 14.6, 15.9, 12.2, 
14.1, 12, 12.8, 17.1, 17, 15, 15.8, 15.9, 16.1, 18, 14.7, 18.9
)
hist(new, xlab='30-day Death Rate',xlim=c(7,22),main=expression("Heart
Attack(" * bar(X) * ")=" *
mean(new)))

I would appreciate any pointers on getting this correct.
Thanks



--
View this message in context: http://r.789695.n4.nabble.com/characters-mathematical-expressions-and-computed-values-tp4645916.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list