Or create a function (reworking Thomas' code):
pretitle <- function(n) bquote(bold("Figure"~.(N)~"Plot"~C[max]~"vs. CrCl"))
plot(0, main = pretitle(1))
On 11/15/06, Thomas Lumley <[EMAIL PROTECTED]> wrote:
> On Tue, 14 Nov 2006, RMan54 wrote:
>
> >
> > This works for the original posted questio
On Tue, 14 Nov 2006, RMan54 wrote:
>
> This works for the original posted question:
>
> n<-5
> title <- bquote(bold(paste("Figure ", .(n), ": Plot ", C[max], " versus
> CrCl")))
> plot(1, main=title)
>
> However, my problem is that I want to define the text before the value of n
> is known.
> The
This works for the original posted question:
n<-5
title <- bquote(bold(paste("Figure ", .(n), ": Plot ", C[max], " versus
CrCl")))
plot(1, main=title)
However, my problem is that I want to define the text before the value of n
is known.
The idea is that the title is defined ahead, passed to a f
gt; Thanks again,
> Rene
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, November 14, 2006 12:42 PM
> To: [EMAIL PROTECTED]
> Cc: r-help@stat.math.ethz.ch
> Subject: Re: [R] Plot title with numeric variables
>
> The ke
cat doesn't work with "bquoted" arguments. At least not with the simple
cat(xxx, ccc).
Rene
_
From: Jeffrey Robert Spies [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 1:58 PM
To: Rene Braeckman
Cc: r-help
Subject: Re: [R] Plot title with numeric variab
IL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 12:42 PM
To: [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Plot title with numeric variables
The key thing is the function bquote().
E.g.
> N <- 5
> xxx <- bquote(bold("Figur
The key thing is the function bquote().
E.g.
> N <- 5
> xxx <- bquote(bold("Figure"~.(N)~"Plot"~C[max]~"versus CrCl"))
> plot(1:10,main=xxx)
(Not sure about the ``bold'' business, but R doesn't object.)
Or to take a simpler and clearer example:
> N <- 5
I am trying to create a plot title in R with substitution by a numeric
variable (Figure number N) within the text which is bold and has a
subcripted part as well. Here is what I have:
title <- expression(bold(paste("Figure ", N, ": Plot ", C[max], " versus
CrCL")))
plot(1, main="") # Simple plot