I have the following code:
library(ggpubr)
ggscatter(mtcars[mtcars$cyl==4,], x = "drat", y = "wt",
add = "reg.line", add.params = list(color = "black", fill = "grey"),
conf.int = TRUE, cor.method = "spearman", cor.coef = TRUE)
How can I change the position of the stats ("R=-0.47, p=0.14") to the right? All the way to the right or to the middle?
Try this. You can play around
cor.coeff.args
option to enable the position of your correlation label. Here the code:Output:
Or this option to keep same original style:
Output: