How to add RMSE value on a plot with ggplot

I added r2 value and the formula of the regression function but I also want RMSE value on my plot, maybe I need to add something but I could not see a proper answer to this question neither here nor google...

ggplot(data = AGB.rf$pred) + 
  geom_point(mapping = aes(x = pred, y = obs, color = pred, shape=1))+
  geom_smooth(mapping = aes(x = pred, y = obs), method=lm, se = FALSE)+
  stat_cor(aes(x = pred, y = obs, label =  ..rr.label..),label.y = 3000)+ 
  #stat_regline_equation(aes(x = pred, y = obs),label.y = 2700)+ 
  labs(title = Predicted Values vs. Observed Values with Random Forest Model, x = Predicted AGB, y=Observed AGB)+
  theme_light() + scale_shape_identity()

Topic rmse ggplot2 r

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.