I have a dataframe that looks like this:
DATE SURVEY SPECIES COUNT
07/12/16 13 Paka 1
07/12/16 14 Paka 1
07/12/16 15 Grouper 2
07/12/16 16 Grouper 3
07/12/16 18 Grouper 1
07/12/16 20 Lehi 3
Where 'Count' is the number of individuals observed for each given survey. I'd like to reshape the data so that there is a single row (record) for each individual: e.g.:
DATE SURVEY SPECIES
07/12/16 13 Paka
07/12/16 14 Paka
07/12/16 15 Grouper
07/12/16 15 Grouper
07/12/16 16 Grouper
07/12/16 16 Grouper
07/12/16 16 Grouper
07/12/16 18 Grouper
07/12/16 20 Lehi
07/12/16 20 Lehi
07/12/16 20 Lehi
With the data for each survey replicated as many times as needed. I considered using the melt() or summarise() functions but am stuck because the COUNT variable ranges anywhere from 1 - 10.
Thanks