Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #I have the following boxplot
- ToothGrowth%>%ggplot(aes(x=dose, y=len, fill=supp))+
- geom_boxplot()
- #I would like to do a wilcoxon sum rank test on the data and label each comparison between OJ and VC
- stat.test <- ToothGrowth%>%group_by(dose)%>%wilcox_test(len~supp, p.adjust.method = 'BH')%>%
- mutate(y.position = c(29, 35, 39))
- stat.test
- #I try to add the p-values to my boxplots
- ToothGrowth%>%ggplot(aes(x=dose, y=len, fill=supp))+
- geom_boxplot()+
- stat_pvalue_manual(stat.test, label = 'p')
- #However I get the following error:
- # Error in FUN(X[[i]], ...) : object 'supp' not found
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement