[R] plotmath: unexpected SPECIAL

Uwe Ligges ligges at statistik.tu-dortmund.de
Thu Jun 23 12:30:43 CEST 2011


Folks,

the relevant thing you have to remember is: All the stuff must be valid 
R syntax (with few additional functions as mention in the ?plotmath help 
file). Knowing that it is obvious where additional "operators" are required.

Best,
Uwe Ligges


On 23.06.2011 02:56, Bryan Hanson wrote:
> Thanks to both David and Sarah. I'm glad I asked, as I had tried some of
> the combos Sarah suggested and observed the same behavior, which puzzled
> me. David, thanks for reminding me about ~ as that is a different way to
> get a space into the string. I just don't use plotmath often enough to
> become decent at it. Thanks again. Bryan
>
> On Jun 22, 2011, at 8:49 PM, David Winsemius wrote:
>
>>
>> On Jun 22, 2011, at 8:10 PM, Bryan Hanson wrote:
>>
>>> Hello R Masters and the Rest of Us:
>>>
>>> The first of these works fine, the 2nd is accepted but too literal
>>> (the "%->%" is shown in the plot label and in the wrong position).
>>> The 3rd throws and error due to "unexpected SPECIAL". Would someone
>>> recommend a way to format this? I want the two phrases connected by a
>>> right arrow.
>>>
>>> TIA, these things always elude me. Bryan
>>> ***********
>>> Bryan Hanson
>>> Professor of Chemistry & Biochemistry
>>> DePauw University
>>>
>>> xlab1 <-expression(paste("Phase Angle ", phi, " Neat-O"))
>>> xlab2 <- expression(paste("treatment: low stress", "high stress", sep
>>> = "%->%"))
>>> xlab3 <- expression(paste("treatment: low stress", %->%, "high stress"))
>>>
>>> plot(1:10, main = xlab1)
>>> plot(1:10, main = xlab2)
>>
>> Doesn't seem that %->% "works" without flanking terms
>>
>> xlab3 <- expression(treatment*":"~low~stress %->% high~stress)
>> plot(1, main=xlab3)
>>
>> Or:
>>
>> xlab3 <- expression("treatment: low stress" %->% high~stress)
>> plot(1, main=xlab3)
>>
>> --
>> David Winsemius, MD
>> West Hartford, CT
>>
>
> ______________________________________________
> 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.



More information about the R-help mailing list