dabestr icon indicating copy to clipboard operation
dabestr copied to clipboard

subscript and formulas in rawplot.ylabel

Open daniele7 opened this issue 5 years ago • 1 comments

Hi, I would like to include in the rawplot.ylabel special characters and chemical formulas. I have tried few approach but so far no lack. do you have any suggestion? thanks D

daniele7 avatar Sep 18 '19 05:09 daniele7

Hi,

Thanks for flagging this up. For some reason we use stringr::str_interp() when passing the user-defined ylabel. This results in any expression() and related commands being parsed directly.

I'll roll a fix to allow for this shortly. In the meantime, you'll have to use unicode characters. (See these Stack Overflow posts: Post 1; Post 2)

library(dabestr)

# Performing unpaired (two independent groups) analysis.
unpaired_mean_diff <- dabest(iris, Species, Petal.Width,
                             idx = c("setosa", "versicolor", "virginica"),
                             paired = FALSE)

plot(unpaired_mean_diff, rawplot.ylabel = "Title (\u03b1 \u03a9)" )

Demo image with unicode ylabel

Sorry for the inconvenience! Hope this helps.

josesho avatar Sep 18 '19 07:09 josesho