Skip to content
Prev 303397 / 398503 Next

How to join two plotmath type expressions

HI,
Try this:
plot(1:10, type='n')
?newtxt<-bquote(paste("Temperature", "(",degree*C,")",sep=""))
?mtext(newtxt,3)

A.K.



----- Original Message -----
From: Trevor Carey-Smith <trevor.carey-smith at niwa.co.nz>
To: r-help at r-project.org
Cc: 
Sent: Tuesday, August 14, 2012 11:56 PM
Subject: [R] How to join two plotmath type expressions

If I have two variables set, one of which holds an expression, for example:
how can I join them together for use in mtext (or equivalent)? The
following is conceptually what I want to do, but will obviously not work:
Preferably, I would like this to work if one, both or neither of label
and unit are expressions.

Thanks,
Trevor.
--
Please consider the environment before printing this email.
NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.

______________________________________________
R-help at r-project.org 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.