R
package ggpmisc
can be used to show equation of lm
model and poly
model on ggplot2
(See here for reference). I wonder how I could show nls
model equation results on ggplot2
using ggpmisc
. Below is my MWE.
library(ggpmisc)
args <- list(formula = y ~ k * e ^ x,
start = list(k = 1, e = 2))
ggplot(mtcars, aes(wt, mpg)) +
geom_point() +
stat_fit_augment(method = "nls",
method.args = args)
See Question&Answers more detail:os