[R] italics letter in roman string

Gabor Grothendieck ggrothendieck at gmail.com
Sun Mar 18 06:10:44 CET 2007


Try this:

plot(1:10)
legend("topleft", This ~ study ~ italic(n) == 3293)


On 3/17/07, Chabot Denis <chabotd at globetrotter.net> wrote:
> Hi,
>
> As part of the legend to a plot, I need to have the "n" in italics
> because it is a requirement of the journal I aim to publish in:
> "This study, n = 3293"
>
> Presently I have:
> legend(20, 105, "This study, n = 3293", pch=1,  col=rgb(0,0,0,0.5),
>                 pt.cex=0.3, cex=0.8, bty="n")
>
> I suppose I could leave a blank in place of the "n", then issue a
> text call where I'd use font=3 for a single letter, "n". But it will
> be tricky to find the exact location to use.
>
> Is there a way to switch to font=3 just for one letter within a string?
>
> Thanks in advance,
>
> Denis Chabot
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>



More information about the R-help mailing list