Violinplot in R with discrete values
问题 I'm trying to create a violin plot in R from count data. The data I use is a number of mutations that is found in each sample for each source. It looks something like this: 2 Source1 8 Source2 0 Source1 1 Source1 9 Source2 ... I already used the code below to create several plots. ggplot(df_combined, aes(factor(names), y=mutations)) + geom_violin() + geom_boxplot(width=.1, outlier.size=0, fill="grey50") + stat_summary(fun.y=median, geom="point", fill="white", shape=21, size=4) + xlab("Source"