cell_E: Aggregate compositional data within each cell

Description Usage Arguments Value Note

View source: R/fn_aux.R

Description

Reformat and calculate expected cell-means based on land cover composition for relevant parameters.

Usage

1
2
cell_E(lc.df, K, s.M, s.N, mu, p.f, p.c, p, g.B, g.D, p.trt = NULL,
  edges = "wall", method = "wt.mn", p.trt_OpnOnly = F)

Arguments

lc.df

Dataframe or tibble with xy coords, land cover proportions, other covariates, and cell id info

K

Vector length=n.lc with carrying capacity for each land cover type or vector of slopes corresponding with columns in lc.df

s.M

Vector length=n.lc with juvenile survival probability for each land cover type or vector of slopes corresponding with columns in lc.df

s.N

Vector length=n.lc of annual adult survival rates or vector of slopes corresponding with columns in lc.df

mu

Vector length=n.lc with mean per-individual fruit production for each land cover type or vector of slopes corresponding with columns in lc.df

p.f

Vector length=n.lc with mean probability of fruiting for each land cover type or vector of slopes corresponding with columns in lc.df

p.c

Vector length=n.lc with proportion of fruits eaten by birds for each land cover type or vector of slopes corresponding with columns in lc.df

p

Vector length=n.lc with seedling establishment probability for each land cover type or vector of slopes corresponding with columns in lc.df

g.B

Vector length=n.lc with seed bank germination probability for each land cover type or vector of slopes corresponding with columns in lc.df

g.D

Vector length=n.lc with direct germination probability for each land cover type or vector of slopes corresponding with columns in lc.df

p.trt

Tibble with grid id and modified establishment probabilities for cells with ground cover treatments; default = NULL

edges

Character taking the value of one of: "wall", "sink", "none" where "wall" results in a dispersal probability of 0 for all out-of-bound cells with no populations modeled, "sink" results in dispersal of seeds to out-of-bound cells but no populations modeled, and "none" results in dispersal of seeds and populations modeled

method

"wt.mn" Method for calculating cell expectations, taking values of "wt.mn" or "lm". If "wt.mn", the expectation for each parameter is the weighted mean across land cover types proportional to their coverage, with the land cover specific values stored in the parameter vectors. If "lm", the expectation is calculated in a regression with the slopes contained in each parameter vector. Individuals cannot be assigned to specific land cover categories with "lm", so "m" must be scalar.

p.trt_OpnOnly

FALSE Do ground cover treatments only apply to Open land cover types?

Value

Named list with values aggregated within cells based on land cover types. Includes:

lc.mx

Matrix (ncol=n.lc, nrow=ngrid) with land cover proportions

K.E

Vector length=ngrid with total K

K.lc

Matrix (ncol=n.lc, nrow=ngrid) with K per land cover category

s.M.E

Vector length=ngrid with pr(juvenile surv)

rel.dens

Matrix (ncol=n.lc, nrow=ngrid) with relative density among land cover categories

mu.E

Vector length=ngrid with mean fruit produced per adult)

p.f.E

Vector length=ngrid with fruiting probability

p.c.E

Vector length=ngrid with proportion eaten by birds

p.E

Vector length=ngrid with seedling establishment probabilities

Note

If method="lm", then each parameter vector will be treated as a set of slopes for the covariates in lc.df with the number of covariates used in each regression is length(param)-1 and the first element of param is the intercept.

If !is.null(p.trt), then the associated p.E values are substituted in the cells that received a relevant management treatments.


Sz-Tim/gbPopMod documentation built on Dec. 7, 2020, 1:07 p.m.