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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -