Learn R Programming

lefko3 (version 3.1.0)

overwrite: Create an Overwrite Table for MPM Development

Description

overwrite() returns a data frame describing which particular transitions within an ahistorical or historical projection matrix to overwrite with either given rates and probabilities, or other estimated transitions.

Usage

overwrite(
  stage3,
  stage2,
  stage1 = NA,
  eststage3 = NA,
  eststage2 = NA,
  eststage1 = NA,
  givenrate = NA,
  type = NA
)

Arguments

stage3

The name of the stage in time t+1 in the transition to be replaced.

stage2

The name of the stage in time t in the transition to be replaced.

stage1

The name of the stage in time t-1 in the transition to be replaced. Only needed if a historical matrix is to be produced. Use rep if all reproductive stages are to be used, and leave empty or use all if all stages in stageframe are to be used.

eststage3

The name of the stage to replace stage3. Only needed if a transition will be replaced by another estimated transition.

eststage2

The name of the stage to replace stage2. Only needed if a transition will be replaced by another estimated transition.

eststage1

The name of the stage to replace stage1. Only needed if a transition will be replaced by another estimated transition, and the matrix to be estimated is historical.

givenrate

A fixed rate or probability to replace for the transition described by stage3, stage2, and stage1.

type

A vector denoting the kind of transition that will be replaced. Should be entered as 1, S, or s for survival, or 2, F, or f for fecundity. Defaults to 1, for survival transition.

Value

A data frame that puts the above vectors together and can be used as input in flefko3, flefko2, rlefko3, and rlefko2.

Variables in this data frame include the following:

stage3

Stage at time t+1 in the transition to be replaced.

stage2

Stage at time t in the transition to be replaced.

stage1

Stage at time t-1 in the transition to be replaced.

eststage3

Stage at time t+1 in the transition to replace the transition designated by stage3, stage2, and stage1.

eststage2

Stage at time t in the transition to replace the transition designated by stage3, stage2, and stage1.

eststage1

Stage at time t-1 in the transition to replace the transition designated by stage3, stage2, and stage1.

givenrate

A constant to be used as the value of the transition.

convtype

Designates whether the transition is a survival-transition probability (1) or a fecundity rate (2).

Examples

Run this code
# NOT RUN {
cypover2r <- overwrite(stage3 = c("SD", "P1", "P2", "P3", "SL", "SL", "D", 
                       "XSm", "Sm"), stage2 = c("SD", "SD", "P1", "P2", "P3", 
                       "SL", "SL", "SL", "SL"), eststage3 = c(NA, NA, NA, NA, 
                       NA, NA, "D", "XSm", "Sm"), eststage2 = c(NA, NA, NA, NA, 
                       NA, NA, "XSm", "XSm", "XSm"), givenrate = c(0.1, 0.2, 
                       0.2, 0.2, 0.25, 0.4, NA, NA, NA), type = c("S", "S", "S",
                       "S", "S", "S", "S", "S", "S"))

cypover2r

cypover3r <- overwrite(stage3 = c("SD", "SD", "P1", "P1", "P2", "P3", "SL", 
                       "SL", "SL", "D", "XSm", "Sm", "D", "XSm", "Sm"), 
                       stage2 = c("SD", "SD", "SD", "SD", "P1", "P2", "P3", 
                       "SL", "SL", "SL", "SL", "SL", "SL", "SL", "SL"),
                       stage1 = c("SD", "rep", "SD", "rep", "SD", "P1", "P2", 
                       "P3", "SL", "P3", "P3", "P3", "SL", "SL", "SL"),
                       eststage3 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA, "D", 
                       "XSm", "Sm", "D", "XSm", "Sm"), eststage2 = c(NA, NA, NA, 
                       NA, NA, NA, NA, NA, NA, "XSm", "XSm", "XSm", "XSm", "XSm",
                       "XSm"), eststage1 = c(NA, NA, NA, NA, NA, NA, NA, NA, NA,
                       "XSm", "XSm", "XSm", "XSm", "XSm", "XSm"), 
                       givenrate = c(0.1, 0.1, 0.2, 0.2, 0.2, 0.2, 0.25, 0.4,
                       0.4, NA, NA, NA, NA, NA, NA), type = c("S", "S", "S", 
                       "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", "S", 
                       "S"))

cypover3r

# }

Run the code above in your browser using DataLab