Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRewrite stat_cor() to make formatting easy for p-value and cor.coef #270
Comments
suppressPackageStartupMessages(library(ggpubr))
# Default plot
sp <- ggscatter(mtcars, x = "wt", y = "mpg", add = "reg.line")
sp + stat_cor(label.x = 3)
#> `geom_smooth()` using formula 'y ~ x'# Specify the number of decimal places of precision for
# the p-value and the correlation coefficient r
sp + stat_cor(label.x = 3, p.accuracy = 0.001, r.accuracy = 0.01)
#> `geom_smooth()` using formula 'y ~ x'Created on 2020-05-10 by the reprex package (v0.3.0.9001) |


Related issue: #114 and #186