data(impact)
by(impact, impact$name, summary)
# Plot the distribution of age by study
library(ggplot2)
e <- ggplot(impact, aes(x = name, y = age))
e + geom_violin(aes(fill = type), trim = FALSE) +
theme(axis.text.x = element_text(angle = 45)) +
xlab("Study")
Run the code above in your browser using DataLab