speciesRasterToPhyloComm: Convert speciesRaster to community matrix

View source: R/speciesRasterToPhyloComm.R

speciesRasterToPhyloCommR Documentation

Convert speciesRaster to community matrix

Description

Given specific sites, convert speciesRaster to phylocomm matrix, with sites as rows, and species as columns

Usage

speciesRasterToPhyloComm(x, sites)

Arguments

x

object of class speciesRaster

sites

locations of sites, see details.

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.

Value

community matrix, with sites as rows and species as columns

Author(s)

Pascal Title

Examples

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)


ptitle/speciesRaster documentation built on June 11, 2022, 1:35 a.m.