r - plotmath: how to use a function definition in a label? -
i display definition of lambda
in x axis label. of course adjust hand, e.g., this:
lambda <- function(t) 1/t plot(0~0, xlab=expression(lambda(t)==1/t))
but there way can let plotmath display function definition of lambda
(so not having manually adjust xlab
)?
you can use solution:
lambda <- function(t) 1/t sb <- as.character(as.expression(body('lambda'))) plot(0~0, xlab=bquote(lambda(t)==.(sb)))
Comments
Post a Comment