Skip to content
Prev 311793 / 398503 Next

characters, mathematical expressions and computed values

On Nov 24, 2012, at 5:20 AM, mee1d3hs wrote:

            
I sent a message yesterday that indicated that one of you earlier  
attempts was successful on my machine running the same (or roughly the  
same OS) and a current version of R. You seem to be ignoring the  
possibility that your R installation is broken.
This should "work", at least to the extent of putting nothing  after  
the equal sign. As should this:

hist(x,main=expression(3.~~bar(X)==phantom() ) )

The bquote function allows you to specify what portion of the  
expression will be evaluated. Otherwise everything gets displayed as  
typed (or interpreted by the plotmath evaluation engine). The tilde  
and asterisk are plotmath separators. Using them to bind together  
plotmath or text items will generally be much more readable than using  
paste.
It's either bquote() or expression(). Do not mix them unless you  
understand why they shouldn't be mixed.  Should be:

hist(x,main=bquote(4.~~bar(x)==.(meanx) ) )
This displays on my machine. (with "expression(.)" where the dot is a  
correctly drawn x-bar
)
That displays properly on my machine.