Articles

Affichage des articles du octobre, 2016

bquote() in direct use for plot() or for a do.call(plot, ) use

The behavior of bquote() is different if it is used directly in a function or stored in a list to be used with de do.call(): Let try: > plot(1, 1, ylab=bquote(expr = "1000"^"-1")) > L <- list(x=1, y=1, ylab=bquote(expr = "1000"^"-1")) > do.call(plot, L) Error in "1000"^"-1" : argument non numérique pour un opérateur binaire The correct solution is to convert the bquote() as an expression: > plot(1, 1, ylab=as.expression(bquote(expr = "1000"^"-1"))) > L <- list(x=1, y=1, ylab=as.expression(bquote(expr = "1000"^"-1"))) > do.call(plot, L)