library(reshape2)
library(ggplot2)
dt <- data.frame(Hr = 1:5,
Sp1 = c(8, 3, 5, 7, 5),
Sp2 = c(25, 14, 25, 26, 19),
Sp3 = c(1, 0, 1, 1, 0),
Sp4 = c(7, 50, 4, 4, 7),
Sp5 = c(7, 4, 10, 11, 11))
data <- melt(dt, id = c("Hr"))
data <- data.frame(Hr = rep(data$Hr, data$value),
variable = rep(data$variable, data$value))
ggplot(data, aes(Hr, colour = variable)) + geom_density()
http://ggplot2.tidyverse.org/reference/geom_density.html