Try this:
plot(1)
tmp <- x >= 3 ~ "&" ~ y <= 3
mtext(tmp)
On Mon, Aug 20, 2018 at 5:00 PM MacQueen, Don via R-help
wrote:
>
> I would like to use plotmath to annotate a plot with an expression that
> includes a logical operator.
>
> ## works well
> tmp <- expression(x >= 3)
> plot(1)
>
proach to set up a system that helps me to interactively
>> review various subsets of a large set of data. I save the final selected
>> subsetting expressions in some sort of data structure, for later use in
>> preparing a report using rmarkdown.
>>
>> I was hoping to use p
ueen
> Lawrence Livermore National Laboratory
> 7000 East Ave., L-627
> Livermore, CA 94550
> 925-423-1062
> Lab cell 925-724-7509
>
>
>
> From: Bert Gunter
> Date: Monday, August 20, 2018 at 3:38 PM
> To: "MacQueen, Don"
> Cc: array R-help
> Subject
> 925-423-1062
>
> Lab cell 925-724-7509
>
>
>
>
>
>
>
> *From: *Bert Gunter
> *Date: *Monday, August 20, 2018 at 3:38 PM
> *To: *"MacQueen, Don"
> *Cc: *array R-help
> *Subject: *Re: [R] plotmath and logical operators?
>
>
>
cell 925-724-7509
From: Bert Gunter
Date: Monday, August 20, 2018 at 3:38 PM
To: "MacQueen, Don"
Cc: array R-help
Subject: Re: [R] plotmath and logical operators?
This is clumsy and probably subject to considerable improvement, but does it
work for you:
left <- quote(x >= 3)
This is clumsy and probably subject to considerable improvement, but does
it work for you:
left <- quote(x >= 3)
right <- quote(y <= 3) ## these can be anything
## the plot:
plot(1)
eval(substitute(mtext(expression(paste(left, " & ",right))), list(left =
left, right = right)))
## Expression
I would like to use plotmath to annotate a plot with an expression that
includes a logical operator.
## works well
tmp <- expression(x >= 3)
plot(1)
mtext(tmp)
## not so well
tmp <- expression(x >= 3 & y <= 3)
plot(1)
mtext(tmp)
Although the text that's displayed makes sense, it won't be
7 matches
Mail list logo