I would like to create violin sections with aggregated data. My data has a category, value column and count column:
data <- data.frame(category = rep(LETTERS[1:3],3), value = c(1,1,1,2,2,2,3,3,3), count = c(3,2,1,1,2,3,2,1,3))
If I create a simple violin plot, it will look like this:
plot <- ggplot(data, aes(x = category, y = value)) + geom_violin() plot

(source: ahschulz.de )
This is not what I wanted. The solution is to change the shape of the data frame by multiplying the lines of each category-value combination. The problem is that my calculations are in the millions, and it takes hours to schedule! :-(
Is there a solution with my data?
Thank you in advance!
ahs85 source share