Re: [ECOLOG-L] Making Species Co-Occurrence Matrix

2010-09-01 Thread Jane Shevtsov
Hi Gavin, Thanks! For just getting the data into R, speed isn't an issue, but it could be important for null model analysis. But is it possible to make this function correspond to my version that changed any() to sum() in order to make the co-occurrence matrix say how many times the species co-occ

Re: [ECOLOG-L] Making Species Co-Occurrence Matrix

2010-09-01 Thread Gavin Simpson
Andy, Jane, If speed is an issue or you are working with larger problems than the example Andy used, then we can exploit other tools in R to get the same answer as Andy's spp.cooc() function, but much more efficiently, using a matrix multiplication: Here's Andy's example and my version with some

Re: [ECOLOG-L] Making Species Co-Occurrence Matrix

2010-08-28 Thread Jane Shevtsov
Thanks, Andy. I made a small modification to the code to make it give the number of sites at which two species co-occur. (This just involves changing "any" to "sum".) spp.cooc.count <- function(matrx) { # first we make a list of all the sites where each spp is found site.list <- apply(matr

Re: [ECOLOG-L] Making Species Co-Occurrence Matrix

2010-08-27 Thread Andy Rominger
Hi Jane, I think someone may have asked something similar on the r-sig-eco email list (which is a good resource in general: https://stat.ethz.ch/mailman/listinfo/r-sig-ecology) I think the answer may have been there there's a function in the vegan package for R (http://cran.r-project.org/web/pack

[ECOLOG-L] Making Species Co-Occurrence Matrix

2010-08-27 Thread Jane Shevtsov
Is there a fast way to make a species co-occurrence matrix given a site-species matrix or lists of species found at each site? I'm looking for a spreadsheet or database method (preferably OpenOffice) or R function. Thanks, Jane -- - Jane Shevtsov Ecology Ph.D. candidate, University o