get_gradient_di: Dimorphic selection gradients

View source: R/get_gradient_di.R

get_gradient_diR Documentation

Dimorphic selection gradients

Description

Computes the selection gradients of the two morphs after branching has occurred.

Usage

get_gradient_di(xres1, xres2, pars, init)

Arguments

xres1

The resident trait value in the first morph

xres2

The resident trait value in the second morph

pars

An unevaluated parameter-list (e.g. as returned by get_default_pars)

init

A vector of four starting values for solving of the demographic equilibrium

Details

The functions uses find_equilibrium_di to compute the equilibrium population sizes (in the two habitats and for the two morphs) given the resident trait values, which are needed to compute the gradients.

Value

A vector of two selection gradients, one for each morph

See Also

find_equilibrium_di

Examples


pars <- get_default_pars()
get_gradient_di(-0.001, 0.001, pars, init = rep(1000, 4))


rscherrer/speciomx documentation built on March 28, 2023, 8:49 p.m.