Build a spesim_result directly from observed data
Source: R/network_observed.R
spesim_from_observed.RdCreates a full spesim_result object using real observed site x species
data, site coordinates, and optional site-level environment. No simulation is
performed.
Usage
spesim_from_observed(
abund_matrix,
site_coords,
site_env = NULL,
domain = NULL,
env_gradients = NULL,
edges = NULL,
order_by = NULL,
directed = FALSE,
wrap = FALSE,
point_jitter = 0
)Arguments
- abund_matrix
Data frame with first column
siteand remaining species abundance columns.- site_coords
Data frame with columns
site,x,y.- site_env
Optional data frame with
siteand environmental columns.- domain
Optional
sfpolygon domain. IfNULL, a convex hull + small buffer is built fromsite_coords.- env_gradients
Optional environmental grid. If
NULL, a point grid is created fromsite_envjoined tosite_coords.- edges
Optional edge table (
from,to, optionalweight) defining connectivity among sites.- order_by
Optional ordering used to build chain edges when
edgesisNULL.- directed
Logical; treat connectivity as directed.
- wrap
Logical; only used when chain edges are auto-built.
- point_jitter
Numeric jitter for reconstructed
species_distpoints.