I have a data set where I have hourly observations of different species. For each hour, all the observations are pooled for each species and this was done for 24 hours. Following is a part of the dataframe:
Hr Sp1 Sp2 Sp3 Sp4 Sp5
1 8 25 1 7 7
2 3 14 0 50 4
3 5 25 1 4 10
4 7 26 1 4 11
5 5 19 0 7 11
I want to plot a density curve for observations of each species against time. Hence, I have 24 continuous groups (0100 hr, 0200 hr....2400 hr) starting from 0000 hr as x-axis, y axis is the counts or observations for each hour over 24 hour for each species. Please suggest how can I do that in R? I also want all species density curves in one plot. How do I do that?
Thanks a lot!
http://ggplot2.tidyverse.org/reference/geom_density.html