Learn R Programming

IPMpack (version 1.6)

makeClonalObj: Function to build clonal reproduction objects

Description

Allows a series of different glms to be fit for all steps of clonal reproduction, e.g., probability of reproducing clonally, number of clonal offspring produced, etc. Currently only pre-census clonal reproduction relationships can be handled.

Usage

makeClonalObj(dataf, fecConstants=data.frame(NA),
		Formula=list(fec~size),Family="gaussian",
		Transform="none",meanOffspringSize=NA,
		sdOffspringSize=NA,offspringSplitter=data.frame(continuous=1),
		vitalRatesPerOffspringType=data.frame(NA),fecByDiscrete=data.frame(NA),
		offspringSizeExplanatoryVariables="1")

Arguments

dataf
a dataframe with columns "size", "sizeNext", "stage", "stageNext", and any number of columns with clonal reproduction data. If clonal reproduction data is transformed via log, etc, this MUST BE MADE CLEAR in the argument Transform
fecConstants
a data-frame containing the value by which each of the product of the fecundity rates will be multiplied in the order defined by the order supplied in the list Formula; these might capture for example the probability of establishment
Formula
a list containing formulas describing the desired explanatory variables (interactions, etc) and response variables in classical R style, i.e. covariates separated by `+', `*', `:'. Possible covariates include `size', 'size2' (size^2), `size3' (size^3
Family
a character vector containing the names of the families to be used for the glms, e.g., binomial, poisson, etc. Again, these must appear in the order defined by Formula
Transform
a character vector containing the names of the transforms to be used for the response variables, e.g., log, sqrt, -1, etc. Again, these must appear in the order defined by Formula
meanOffspringSize
numeric vector, defining mean offspring size. Defaults to NA, in which case the function will use to data to assess the mean offspring size according to the relationship defined in offspringSizeExplanatoryVariables (which either simply fits a mean, or may
sdOffspringSize
numeric vector, defining standard deviation of offspring size. Defaults to NA, in which case the function will use the data to assess the sd in offspring size; as described for meanOffspringSize
offspringSplitter
dataframe with values defining the number of offspring going into the indicated offspring category; will be re-scaled to sum to 1 within the function. This argument needs to be entered as a data.frame, and the names in the data.frame need to preci
vitalRatesPerOffspringType
dataframe defining which fecundity rates (both functions and constants) apply to which offspring category. This only needs to be specified when some fecundity rates do not apply to all offspring categories. The offspring categories in the column name
fecByDiscrete
data.frame defining number of offspring produced by each discrete class ; defaults to 0. If specified, ALL discrete classes MUST appear in alphabetical order, so NO "continuous". e.g. fecByDiscrete=data.frame(dormant=0,seedAge1=4.2,seedOld=0)
offspringSizeExplanatoryVariables
a character defining the relationship defining offspring size; the default is "1", indicating simply fitting a mean and a variance; alternatives would including defining offspring size as a function of maternal size (i.e., offspringSizeExplanatoryVariable

Value

  • an object of class fecObj

Details

This function fits a suite of subfunctions of clonal reproduction towards creating a Clonal transition projection model. Users can define the functional form of each relationship, as well as the distribution and any transforms. There is also a possibility of defining clonal reproduction from discrete sizes into each of the subfunction outcomes; defined in the matrix fecByDiscrete.

See Also

makeSurvObj, makeGrowthObj

Examples

Run this code
# makeClonalObj works exactly the same way as makeFecObj. 
# An example will be added here as soon as we have added a 
# data file on a clonal plant to the package.

Run the code above in your browser using DataLab