Description Usage Arguments Value Note Author(s) See Also Examples
A function that fits regressions that define growth (following next size, size increment, or log size increment) and from these build growth objects for which methods to build an IPM object are defined; alternatively, the function creates growth objects following a specified formula with specified coefficients and sd.
1 2 |
dataf |
a dataframe with columns ‘size’ and ‘sizeNext’(‘size’ is size at t, ‘sizeNext’ is size at t+1); facultatively, dataf may include ‘covariate’ and ‘covariatel’ for a single discrete covariate, indicating values at t, and at t+1, respectively; these must take values of sequential integers, starting at ‘1’. For models fitting growth increment, 'incr' or 'logincr' may be directly provided as a column in the dataframe, otherwise they are calculated as dataf$sizeNext - dataf$size or log(dataf$sizeNext - dataf$size), respectively. |
Formula |
a formula describing the desired
explanatory variables (interactions, etc) according to the R notation for |
regType |
possible values include ‘constantVar’ or ‘changingVar’ |
Family |
possible values include ‘gaussian’, ‘poisson’, ‘negbin’ |
link |
defaults to NULL, currently only relevant with Family="negbin", and only "log" and "identity" are permitted |
coeff |
numeric vector of required coefficients to be imposed if dataf is NULL; must be compatible with Formula |
sd |
numeric of required sd to be imposed if dataf is NULL |
An object of class growthObj, or growthObjPois, growthObjIncr, or growthObjLogIncr; or growthObjDeclineVar, or growthObjIncrDeclineVar, or growthObjLogIncrDeclineVar. These are S4 objects which contain the slots:
fit |
an object of class |
Slots can be listed by using slotNames(growthObj)
See manual for details on building case-specific growth objects. Note that DeclineVar objects cannot currently be constructed without a data-frame.
C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez & Eelke Jongejans
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #generate data
dff <- generateData()
#make simple linear regression growth object relating size to size at t+1
(gr1 <- makeGrowthObj(dataf = dff, Formula = sizeNext~size))
#same but relating size to incr
(gr1 <- makeGrowthObj(dataf = dff, Formula = incr ~ size))
#assess fit
picGrow(dff,gr1)
#same but relating size to incr and discrete covariate
(gr1 <- makeGrowthObj(dataf = dff, Formula = incr ~ size + covariate,
regType = "changingVar"))
#with declining increment
(gr1 <- makeGrowthObj(dataf = dff, Formula = incr ~ size + covariate,
regType = "changingVar"))
#now specifying parameters and supplying no data
gr1 <- makeGrowthObj(Formula = incr ~ size + covariate,coeff=c(1,1,1),sd=1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.