Closed bsuss closed 1 week ago
works on my end
library(ggpubr) library(ggpmisc) mtcars %>% ggscatter( x = "disp", y = "mpg", conf.int = TRUE, title = "AUDIT", ylab = "Total", xlab = "Age", cor.coef = TRUE, # Add correlation coefficient. see ?stat_cor cor.coeff.args = list(method = "kendall", label.x = 3, label.sep = "\n") )+ stat_correlation(label.x= .9, mapping = use_label("tau", "p"), method = "kendall", vstep = 0.1, size = 10/.pt)
Works also for me.
I think I have encountered a bug for adding Kendall tau labels. I am trying to add Kendall's tau to scatterplots with the use_label() argument. This works for Pearson correlations and R2, however, when setting the method to "Kendall", the only stat I am able to successfully print is the P value. Attempting to print "tau" (or "R", "R.CI" which, is in the example documentation) returns this error:
Error in:1:1: unexpected '|'
1: |
^
stat_correlation()
: ! Problem while converting geom to grob. ℹ Error occurred in the 3rd layer. Caused by error inparse()
: !This is code I am trying to use (I am using the ggpubr package, but this works for Pearson correlations)