Skip to content
Back to formatted view

Raw Message

Message-ID: <502B5926.6010202@ymail.com>
Date: 2012-08-15T08:09:10Z
From: Pascal Oettli
Subject: How to join two plotmath type expressions
In-Reply-To: <502B1DF3.5090805@niwa.co.nz>

Hello,

Try this one:

 > mtext(expression(Temperature(degree*C)))

Hope this help

Regards,
Pascal

Le 12/08/15 12:56, Trevor Carey-Smith a ?crit :
> If I have two variables set, one of which holds an expression, for example:
>
>  > label <- 'Temperature'
>  > unit <- expression(paste(degree,'C'))
>
> 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:
>
>  > plot(0:1)
>  > mtext(paste(label,unit))
>
> 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.
>