[R] expression

Peter Ehlers ehlers at ucalgary.ca
Mon Apr 1 23:15:50 CEST 2013


On 2013-04-01 12:46, Jose Narillos de Santos wrote:
> Hi all,
>
> I´m using
>
>
> titt<- expression(paste("R con ventanas de 200 ", italic(datos)))
>
> And it works properly on a plot(...,main=titt,..)
>
> But if I want to add an improvement to avoid typing n on the plot so that
>
> n<-200
>
> titt<- expression(paste("R con ventanas de ",n,  italic(datos)))
>
> It doesn´t recognize that n is a "variable" and adds "n" letter instead of
> 200 on the plot when run:
>
> plot(...,main=titt,..)
>
> How can I include n in the plot authomatically without loosing the italic
> letter?

titt <- bquote("R con ventanas de " ~ .(n) ~ italic(datos))

and I usually find it much more flexible to add the title with a
separate title(titt) call.

Peter Ehlers



More information about the R-help mailing list