require(utils)
x = runif(n = 10, min = 0.2, max = 1)
y = rnorm(n = 10, mean = 2.5, sd = .5)
df = expand.grid(x = x,
y = y)
I used the code below to plot the sqrt(y) ~ assign(sqrt(x))
relationship and show the equation on the graph. The regression line shows, but the equation doesn't.
ggplot(df , aes(x = x, y = y)) +
geom_point() +
geom_smooth( method = "lm", se = TRUE, formula = sqrt(y) ~ asin(sqrt(x)), col = "black") +
stat_poly_eq(mapping = aes(label = after_stat(eq.label)),
formula = sqrt(y) ~ asin(sqrt(x)))
Warning: [38;5;254mComputation failed in `stat_poly_eq()`[39m
Code sample was from https://cran.r-project.org/web/packages/ggpmisc/vignettes/model-based-annotations.html#stat_poly_eq-and-stat_poly_line
stat_fit_tb
or stat_fit_tidy
returned the same warning and no equation.
Thanks for stopping by.