coerceGrowthObj: Function to coerce growth or survival objects, i.e., impose...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Supplied with a growth and survival object, over-writes coefficients, and for growth, the sd of growth

Usage

1
2
coerceGrowthObj(growthObj, coeff, sd)
coerceSurvObj(survObj,coeff)

Arguments

growthObj

an object of class growthObj

survObj

an object of class survObj

coeff

a numeric vector

sd

a numeric vector of length 1

Details

These functions can be used to impose coefficients and sd on growth and survival objects where direct fitting is not desired

Value

an object of class growthObj / survObj

Author(s)

C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez, Eelke Jongejans & Cory Merow.

See Also

makeSurvObj, makeGrowthObj

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
dff<-generateData()

#for growth
gr1 <- makeGrowthObj(dataf=dff,
Formula=sizeNext~size,regType="constantVar")

#halve the slope
gr2 <- coerceGrowthObj(gr1,coeff=c(gr1@fit$coefficients[1],
    gr1@fit$coefficients[2]*0.5),
    sd=gr1@sd)

par(mfrow=c(1,2),pty="s")
picGrow(dff,gr1)
picGrow(dff,gr2)

#for survival
sv1 <- makeSurvObj(dataf=dff,
Formula=surv~size)

#halve the slope
sv2 <- coerceSurvObj(sv1,coeff=c(sv1@fit$coefficients[1],
    sv1@fit$coefficients[2]*0.5))

par(mfrow=c(1,2),pty="s")
picSurv(dff,sv1)
picSurv(dff,sv2)

IPMpack documentation built on May 2, 2019, 2:36 a.m.