I have a big dataset table of species detections in different locations (12 villages consisting out of 4 blocks each - 9 points per blocks). I need to create presence/absence tables for each block (48 blocks = 12 * 4) for all species combined, but also for each species group/guild (in total 20 groups). That would be in total 48*20=960 tables. I could us in excel Pivot table to accomplish this, but isnt there a faster way to do this with R?
My table column looks something like this:
mydata <- structure(list(Sample = c("1", "2", "3", "7", "8", "9", "13", "14", "15"),
Block = c("A", "A", "A", "B", "B","B", "A","A", "A"),
Location = c("Be", "Be", "Be", "Be", "Be", "Be", "Be", "Be", "Be"),
Species = c("a","d","r","a","c","r","a","c", "c"),
Guild1 = c("O", "H", "H","O","I","H","O","I","I")),
.Names = c("Sample", "Block", "Location", "Species", "Guild1"),
class = "data.frame", row.names = c(NA, -3L))
The expected output data should be presence/absence with samples in rows and species in columns. But for each block by location and by guild a separate table by location should be established. So prepared, I can read the data into the program EstimateS to estimate species richness.