This post was copied over from the original post on Github, with a slightly modified title.
rr.digits are overridden to trim trailing zeros in the formatted coefficients and R-square, even if the zeros are part of the significant figures.
A reproducible example (R 3.5.2 and ggpmisc 0.3.0)
coef.digits = 2, a slope of 1.04 should be shown as 1.0. Instead, 1.0 was simplified as 1 and subsequently not displayed. The resultant equation is misleading as the regression line is clearly unparallel with the 1:1 line as shown in the example code below:
library(tidyverse) library(ggpmisc) set.seed(2017) tdf <- data.frame( x = 1:100, y = 1.04 * 1:100 + rnorm(100) ) ggplot(aes(x = x, y = y), data = tdf) + geom_point() + geom_smooth(method = "lm") + stat_poly_eq( aes(label = paste(..eq.label.., ..rr.label.., sep = "*plain(\",\")~")), formula = y ~ x, coef.digits = 2, rr.digits = 3, parse = TRUE ) + geom_abline(slope = 1, intercept = 0, linetype = 2)