I have created a custom geom to plot a line on a figure. Its use is
p<- df |>
ggplot2::ggplot() +
ggplot2::geom_line() +
mypackage::geom_lm(n=n)
The geom works fine in that it plots all it should. However under the hood in the STATLM.r function a few other things are being calculated. Like a pvalue for example.
How do i pass this pvalue from the geom to the resulting ggplot object?
The return statement in the geom currently passes the fitted values used in the plotting