Get phylospatial
community data
ps_get_comm.Rd
Get phylospatial
community data
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)
#> class : SpatRaster
#> dimensions : 20, 20, 10 (nrow, ncol, nlyr)
#> resolution : 1, 1 (x, y)
#> extent : 0, 20, 0, 20 (xmin, xmax, ymin, ymax)
#> coord. ref. :
#> source(s) : memory
#> varnames : t3
#> t2
#> t9
#> ...
#> names : t3, t2, t9, t4, t5, t6, ...
#> min values : 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.000000, ...
#> max values : 0.7257736, 0.8442026, 0.3792027, 0.1641224, 0.6686734, 0.645587, ...
# get distributions for all taxa, as a matrix
pcomm <- ps_get_comm(ps, tips_only = FALSE, spatial = FALSE)