
Simulate hypothetical invader trait profiles from a resident trait pool
Source:R/simulate_invaders.R
simulate_invaders.Rd
Generates trait rows for hypothetical invaders by resampling the empirical distribution of resident traits. Row names are set to the invader IDs.
Arguments
- resident_traits
data.frame with a species ID column and trait columns.
- n_inv
integer; number of invaders to simulate.
- species_col
character; species ID column name in resident_traits.
- trait_cols
NULL or character; which trait columns to use (default: all except species_col).
- mode
"columnwise" (new combinations; default) or "rowwise" (preserve covariance).
- numeric_method
for columnwise numeric traits: "bootstrap" (default), "normal", or "uniform".
- keep_bounds
logical; constrain normal/uniform draws to observed min,max (default TRUE).
- inv_prefix
character; prefix for invader IDs (default "inv").
- keep_species_column
logical; keep species ID column after setting row names (default TRUE).
- seed
NULL or integer; RNG seed.