ps_get_comm: Get 'phylospatial' community data

View source: R/utils.R

ps_get_commR Documentation

Get phylospatial community data

Description

Get phylospatial community data

Usage

ps_get_comm(ps, tips_only = TRUE, spatial = TRUE)

Arguments

ps

phylospatial object.

tips_only

Logical indicating whether only the terminal taxa (TRUE, the default) or all taxa (FALSE) should be returned.

spatial

Logical indicating whether a spatial (SpatRaster or sf) object should be returned. Default is TRUE; if FALSE, a matrix is returned.

Value

Either a SpatRaster with a layer for every taxon, or an sf data frame with a variable for every taxon, depending on which data type was used to create ps.

Examples

ps <- ps_simulate()

# the defaults return a spatial object of terminal taxa distributions:
ps_get_comm(ps)

# get distributions for all taxa, as a matrix
pcomm <- ps_get_comm(ps, tips_only = FALSE, spatial = FALSE)


phylospatial documentation built on April 12, 2025, 1:35 a.m.