Sunday, 15 March 2015

r - plotmath: how to use a function definition in a label? -


I would like to define the definition of lambda in the x axis label, of course I adjust it by hand I can, like, this:

  lambda & lt; - Function (T) 1 / T plot (0 ~ 0, xlab = expression (lambda (t) = = 1 / t))  

But there is a way that I only get Plotmath to < Code> lambda (so do not manually adjust Xlab )

You can use this solution:

  lambda and lieutenant; - Function (T) 1 / T SB & Lt; - as.character (as.expression (body ('lambda')) plot (0 ~ 0, xlab = bquote (lambda (t) = =. (Sb)))  

No comments:

Post a Comment