View source: R/speciesRasterToPhyloComm.R
speciesRasterToPhyloComm | R Documentation |
Given specific sites, convert speciesRaster to phylocomm matrix, with sites as rows, and species as columns
speciesRasterToPhyloComm(x, sites)
x |
object of class |
sites |
locations of sites, see details. |
If sites are site coordinates,
then dataframe or matrix with two columns;
if sites are cell indices, then numeric vector;
if sites = 'all'
, then all cells will be returned as sites.
community matrix, with sites as rows and species as columns
Pascal Title
library(raster) tamiasSpRas # from cell indices cells <- c(22440, 41446, 39283, 37697) speciesRasterToPhyloComm(tamiasSpRas, cells) # from coordinates xy <- xyFromCell(tamiasSpRas[[1]], cells) speciesRasterToPhyloComm(tamiasSpRas, xy)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.