0

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.

Lula
  • 3
  • 3
  • 2
    Could you update your question with a small example that include both the input data and the expected output data? Please read [here](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) for more details on how to build a reproducible example. – josliber May 15 '15 at 00:01
  • The expected output data should be presence/absence with samples in rows and species in columns. Then I want to read the data into the program EstimateS to estimate species richness. Therefore the ready data table need to look like this: – Lula May 15 '15 at 01:02
  • instead of including the additional information in a comment, please edit the question with the "edit" button. – josliber May 15 '15 at 01:06

0 Answers0