[R] bquote in list to be used with do.plot()

Bert Gunter bgunter.4567 at gmail.com
Sat Oct 8 20:43:34 CEST 2016


(Sent too early by mistake)

... and I find that this a bit more transparent:

L <- list(x=1,y=1, ylab = bquote( expression(.(z)^-1),
                          where=list(z = format(scaleY, scientific=FALSE))))


Cheers,
Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sat, Oct 8, 2016 at 11:39 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
> I think there's an error here, although it doesn't affect the result.
> It should be:
>
> L <- list(x=1, y=1,
> ylab=bquote(expression(.(format(scaleY,
>                                              scientific=FALSE)^"-1"))))
> Bert Gunter
>
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Sat, Oct 8, 2016 at 10:11 AM, Duncan Murdoch
> <murdoch.duncan at gmail.com> wrote:
>> On 08/10/2016 12:50 PM, Marc Girondot via R-help wrote:
>>>
>>> Dear members,
>>>
>>> Has someone have a solution to include a bquote() statement in a list to
>>> be used with do.call() ?
>>>
>>> Here is an exemple:
>>>      scaleY <- 10000
>>>      plot(x=1, y=1, ylab=bquote(.(format(scaleY), scientific=FALSE)^"-1"))
>>>
>>> Like that, it works.
>>>
>>> Now he same in a list:
>>>      L <- list(x=1, y=1, ylab=bquote(.(format(scaleY),
>>> scientific=FALSE)^"-1"))
>>>      do.call(plot, L)
>>>          Error in "10000"^"-1" : argument non numérique pour un
>>> opérateur binaire
>>>
>>> It produces an error.
>>>
>>> Any solution?
>>>
>>> (I tries also with substitute() and expression() but I fail also)
>>
>>
>> This seems to work:
>>
>> L <- list(x=1, y=1, ylab=bquote(expression(.(format(scaleY),
>>           scientific=FALSE)^"-1")))
>> do.call(plot, L)
>>
>> Duncan Murdoch
>>
>>
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> 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