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

Patrick Connolly p_connolly at slingshot.co.nz
Fri May 30 10:15:37 CEST 2008


On Fri, 30-May-2008 at 07:29AM +0100, Prof Brian Ripley wrote:

> I think what you are asking for is not a tilde.  That is a raised symbol 
> (an accent), and not as in TeX's $\sim$ .  It is character 126 in the Adobe 
> Symbol encoding (Adobe's name is '\similar'), so one way is
>
> expression(X*symbol("\176")*N(mu, sigma^2))
>
> There are others, and in most circumstances
>
> expression(X * "~" * N(mu, sigma^2))

They say it's easy to be wise after the event.  What I should have
been searching for was justapose in the help for plotmath.

     The available features are also described in the tables below:

       *Syntax*                        *Meaning*
       'x + y'                         x plus y
       'x - y'                         x minus y
       'x*y'                           juxtapose x and y

I must say that wasn't immediately obvious, but it does cover that
second method.  Some wisdom isn't easy to acquire.  Still can't think
of a useful keyword to use so others can find this in the archives.

Thank you Brian and Charilaos.

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___    Patrick Connolly   
 {~._.~}          		 Great minds discuss ideas    
 _( Y )_  	  	        Middle minds discuss events 
(:_~*~_:) 	       		 Small minds discuss people  
 (_)-(_)  	                           ..... Anon
	  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.



More information about the R-help mailing list