From wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|  Mon Sep  5 15:36:30 2022
From: wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n| (Viechtbauer, Wolfgang (NP))
Date: Mon, 5 Sep 2022 13:36:30 +0000
Subject: [Rd] Passing a call as label to text() works differently when the
 call involves paste() vs paste0()
Message-ID: <d6a1ccfe0082445b8f74a32f1e511e48@UM-MAIL3214.unimaas.nl>

Hi all,

Maybe a bit of an esoteric observation, but the second one doesn't work properly:

x <- 2
plot(NA, xlim=c(0,1), ylim=c(0,1))
text(0.5, 0.55, bquote(paste("x =", .(x))))
text(0.5, 0.45, bquote(paste0("x = ", .(x))))

Note that this has nothing to do in particular with bquote(). This is the same issue:

plot(NA, xlim=c(0,1), ylim=c(0,1))
text(0.5, 0.55, as.call(list(quote(paste), "x =", 2)))
text(0.5, 0.45, as.call(list(quote(paste0), "x = ", 2)))

I had a look at C_text in plot.c, but couldn't figure out why the second one is treated differently.

Best,
Wolfgang



[Rd] Passing a call as label to text() works differently when the call involves paste() vs paste0()
Viechtbauer, Wolfgang (NP