I have a data.frame like this:
# Scientific.Name Year
# Sympetrum 2012
# Celithemis eponina 2012
# Celithemis elisa 2012
# Celithemis elisa 2012
# Cordulegaster maculata 2011
# Calopteryx maculata 2011
# Celithemis elisa 2013
# Celithemis elisa 2013
I want to make a data.frame that looks like this:
Year
# Scientific.Name 2011 2012 2013
# Sympetrum 0 1 0
# Celithemis eponina 0 1 0
# Celithemis elisa 0 2 2
# Cordulegaster maculata 1 0 0
# Calopteryx maculata 1 0 0
I am hoping to have one column for unique species names, the rest of the columns to be unique years. I want to count how many times a unique species has been collected in each year and have it be returned as a data.frame. The actual data.frame I want to transform is almost 3,000 observations but I only need 82 rows (82 species).