How might I use plotmath
capabilities to add a multiplicative Poisson-like equation to my plot? Or, given that I'm really close, how can I write this equation without the .
in the middle of the exponent? I tried phantom
but it didn't work (or I'm not using it correctly).
This is used in a looping process to make many plots, so having the ability to swap out the numbers and labels is key.
# ---- Covariate names.
covar1 <- "var1"
covar2 <- "var2"
# ---- Some numbers.
beta0 <- 2.654
beta1 <- -0.084
beta2 <- 1.123
# ---- A boring plot.
plot(seq(0,100,1),seq(0,100,1))
# ---- How to do this without the %.% ?
text(60,20,bquote(paste("Eqn: ","y = ",.(beta0),plain(e)^{.(beta1) %.% "X" [.(covar1)] + .(beta2) %.% "X" [.(covar2)] })))
This should be Eqn: y = 2.654e^{-0.084X_var1 + 1.123X_var2}.
How do I get rid of the dot?