How to use the raw string (such as len/s) in the colnames in ggpubr::ggboxplot
in R? It seems due to purrr::map
library(ggpubr)
data("ToothGrowth")
df <- ToothGrowth
colnames(df) <- c("len/s", "supp", "dose%sd")
ggboxplot(df, x = "dose%sd", y = 'len/s',
color = "dose%sd", palette =c("#00AFBB", "#E7B800", "#FC4E07"),
add = "jitter", shape = "dose%sd")
with error
Error in `purrr::pmap()`:
ℹ In index: 1.
ℹ With name: len/s.
Caused by error in `purrr::map()`:
ℹ In index: 1.
ℹ With name: x.
Caused by error in `parse()`:
! <text>:1:5: unexpected input
1: dose%sd
---
Backtrace:
1. ggpubr::ggboxplot(...)
15. purrr::map(., function(x) parse_expression(x))
16. purrr:::map_("list", .x, .f, ..., .progress = .progress)
20. ggpubr (local) .f(.x[[i]], ...)
21. ggpubr:::parse_expression(x)
22. base::parse(text = x)