Re: [R] Including a tilde in a plotmath-type call

From: Charilaos Skiadas <cskiadas_at_gmail.com>
Date: Thu, 29 May 2008 23:25:55 -0400

On May 29, 2008, at 11:02 PM, p_connolly_at_slingshot.co.nz wrote:

> Suppose I have a plot
> plot(1:10, pch = "")
>
> And I want some text to indicate a Normal distrubition. I could do
> this:
>
> text(5, 6, substitute(X~~~~N(mu, sigma^2)), adj = 0)
> text(5.35, 6, "~", adj = 0)
>
> But that's clumsy, and depending on your plotting device, might not
> even look
> sensible. I'd prefer to be able to do it more directly and
> simply the way these do:
>
> text(5, 1, expression(X %~~% N(mu, sigma^2)), adj = 0)
> text(5, 2, expression(X %prop% N(mu, sigma^2)), adj = 0)
> text(5, 3, expression(X %=~% N(mu, sigma^2)), adj = 0)
>
> They're easy, but they don't give a single tilde. I know how to put a
> tilde(X) or even a wide tilde, but there're not it either.
>
> What did I miss?
>

Does this do it?

text(2, 3, expression(X *"~"* N(mu, sigma^2)), adj = 0)

Haris Skiadas
Department of Mathematics and Computer Science Hanover College



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. Received on Fri 30 May 2008 - 03:29:41 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 01 Jun 2008 - 23:33:49 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive