tableFromSpeciesRaster: Data table from speciesRaster

View source: R/tableFromSpeciesRaster.R

tableFromSpeciesRasterR Documentation

Data table from speciesRaster

Description

Given one or several speciesRaster objects, create a table of values and associated coordinate data.

Usage

tableFromSpeciesRaster(..., n = NULL, dropSingleSpCells = TRUE)

Arguments

...

objects of class speciesRaster, RasterLayer or RasterStack.

n

number of cells to randomly subsample, no subsampling if NULL

dropSingleSpCells

logical; should cells with single species be excluded?

Details

A set of cells are identified in the speciesRaster objects. If n=NULL, then all cells are used, otherwise cells are randomly subsampled. Values at those cells are then returned. This table construction can be particularly useful for subsequent statistical analyses.

Only cells with data in all inputs are returned. If n is greater than the number of cells with data, then fewer than n cells will be returned.

Value

data.frame with input variables, as well as "long" and "lat".

Author(s)

Pascal Title

Examples


tamiasSpRas
tamiasSpRas <- addPhylo_speciesRaster(tamiasSpRas, tamiasTree)
tamiasSpRas <- addTraits_speciesRaster(tamiasSpRas, tamiasTraits)
morphoDisp <- cellMetrics_speciesRaster(tamiasSpRas, metric='disparity')
meanPat <- cellMetrics_speciesRaster(tamiasSpRas, metric='meanPatristic')

tableFromSpeciesRaster(tamiasSpRas, morphoDisp, meanPat, n = 100, dropSingleSpCells = TRUE)


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