ps_simulate: Simulate a toy spatial phylogenetic data set

View source: R/ps_simulate.R

ps_simulateR Documentation

Simulate a toy spatial phylogenetic data set

Description

This function generates a simple phylospatial object that can be used for testing other functions in the package. It is not intended to be realistic.

Usage

ps_simulate(
  n_tips = 10,
  n_x = 20,
  n_y = 20,
  data_type = c("probability", "binary", "abundance"),
  spatial_type = c("raster", "none"),
  seed = NULL
)

Arguments

n_tips

Number of terminals on phylogeny.

n_x

Number of raster cells in x dimension of landscape.

n_y

Number of raster cells in y dimension of landscape.

data_type

Community data type for simulated ranges: either "probability" (default), "binary", or "abundance".

spatial_type

Either "raster" or "none".

seed

Optional integer to seed random number generator.

Value

phylospatial object, comprising a random phylogeny and community matrix in which each terminal has a circular geographic range with a random radius and location. The spatial reference data is a SpatRaster.

Examples

# using all the defaults
ps_simulate()

# specifying some arguments
plot(ps_simulate(n_tips = 50, n_x = 30, n_y = 40, data_type = "abundance"), "comm")

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