CRAN Package Check Results for Package IPMpack

Last updated on 2020-02-19 17:48:09 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 2.1 16.99 108.02 125.01 ERROR
r-devel-linux-x86_64-debian-gcc 2.1 13.93 82.81 96.74 ERROR
r-devel-linux-x86_64-fedora-clang 2.1 161.83 ERROR
r-devel-linux-x86_64-fedora-gcc 2.1 149.98 ERROR
r-devel-windows-ix86+x86_64 2.1 24.00 143.00 167.00 WARN
r-devel-windows-ix86+x86_64-gcc8 2.1 35.00 204.00 239.00 WARN
r-patched-linux-x86_64 2.1 13.19 113.15 126.34 NOTE
r-patched-solaris-x86 2.1 212.60 NOTE
r-release-linux-x86_64 2.1 13.68 112.85 126.53 NOTE
r-release-windows-ix86+x86_64 2.1 25.00 131.00 156.00 NOTE
r-release-osx-x86_64 2.1 NOTE
r-oldrel-windows-ix86+x86_64 2.1 16.00 115.00 131.00 NOTE
r-oldrel-osx-x86_64 2.1 NOTE

Check Details

Version: 2.1
Check: DESCRIPTION meta-information
Result: NOTE
    Malformed Title field: should not end in a period.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64

Version: 2.1
Check: dependencies in R code
Result: NOTE
    'library' or 'require' calls in package code:
     'MCMCpack' 'mvtnorm' 'truncnorm'
     Please use :: or requireNamespace() instead.
     See section 'Suggested packages' in the 'Writing R Extensions' manual.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64

Version: 2.1
Check: R code for possible problems
Result: NOTE
    .alteredFit: no visible global function definition for 'rnorm'
    .createFecObj: no visible global function definition for 'rnorm'
    .createFecObj: no visible global function definition for 'rbinom'
    .createGrowthObj: no visible global function definition for 'rnorm'
    .createGrowthObj: no visible global function definition for 'lm'
    .createGrowthObj: no visible global function definition for 'new'
    .createSurvObj: no visible global function definition for 'rnorm'
    .createSurvObj: no visible global function definition for 'glm'
    .createSurvObj: no visible binding for global variable 'binomial'
    .createSurvObj: no visible global function definition for 'new'
    .deathDataAugment: no visible global function definition for 'rnorm'
    .deathDataAugment: no visible global function definition for 'sd'
    .fecPostCensus: no visible global function definition for 'dnorm'
    .fecPostCensus: no visible global function definition for 'predict'
    .fecPostCensusInteger: no visible global function definition for
     'dpois'
    .fecPostCensusInteger: no visible global function definition for
     'predict'
    .fecPostCensusInteger: no visible global function definition for
     'dnbinom'
    .fecPreCensus: no visible global function definition for 'dnorm'
    .fecPreCensus: no visible global function definition for 'predict'
    .fecPreCensusInteger: no visible global function definition for 'dpois'
    .fecPreCensusInteger: no visible global function definition for
     'predict'
    .fecPreCensusInteger: no visible global function definition for
     'dnbinom'
    .fecRaw: no visible global function definition for 'predict'
    .generateDataDiscrete: no visible global function definition for
     'rnorm'
    .generateDataDiscrete: no visible global function definition for
     'rbinom'
    .generateDataDiscrete: no visible global function definition for
     'quantile'
    .generateDataStoch: no visible global function definition for 'rnorm'
    .generateDataStoch: no visible global function definition for 'rbinom'
    .generateDataStoch: no visible global function definition for
     'quantile'
    .generateDataStoch: no visible global function definition for 'runif'
    .getIPMoutput: no visible global function definition for 'median'
    .getListRegObjects: no visible global function definition for 'rmvnorm'
    .getListRegObjects: no visible global function definition for 'vcov'
    .getListRegObjectsFec: no visible global function definition for
     'rmvnorm'
    .getListRegObjectsFec: no visible global function definition for 'vcov'
    .offspringCum: no visible global function definition for 'pnorm'
    .offspringCum: no visible global function definition for 'predict'
    .plotResultsStochStruct: no visible global function definition for
     'par'
    .plotResultsStochStruct: no visible global function definition for
     'plot'
    .plotResultsStochStruct: no visible global function definition for
     'abline'
    .plotResultsStochStruct: no visible global function definition for 'sd'
    .plotResultsStochStruct: no visible global function definition for
     'matplot'
    addPdfGrowthPic: no visible global function definition for 'points'
    diagnosticsPmatrix: no visible global function definition for 'par'
    diagnosticsPmatrix: no visible global function definition for 'hist'
    diagnosticsPmatrix: no visible global function definition for 'axis'
    diagnosticsPmatrix: no visible global function definition for 'plot'
    diagnosticsPmatrix: no visible global function definition for 'text'
    diagnosticsPmatrix: no visible global function definition for 'arrows'
    diagnosticsPmatrix: no visible global function definition for 'title'
    diagnosticsPmatrix: no visible global function definition for 'abline'
    diagnosticsPmatrix: no visible global function definition for 'points'
    diagnosticsPmatrix: no visible global function definition for 'legend'
    diagnosticsPmatrix: no visible global function definition for
     'quantile'
    diagnosticsPmatrix: no visible global function definition for 'predict'
    diagnosticsPmatrix: no visible global function definition for 'mtext'
    diagnosticsPmatrix: no visible global function definition for 'dnorm'
    diagnosticsPmatrix: no visible global function definition for
     'dtruncnorm'
    diagnosticsPmatrix: no visible global function definition for 'dlnorm'
    generateData: no visible global function definition for 'rnorm'
    generateData: no visible global function definition for 'rbinom'
    generateData: no visible global function definition for 'quantile'
    makeCompoundFmatrix: no visible global function definition for 'new'
    makeCompoundPmatrix: no visible global function definition for 'new'
    makeDiscreteTrans: no visible global function definition for 'sd'
    makeDiscreteTrans: no visible global function definition for 'glm'
    makeDiscreteTrans: no visible binding for global variable 'binomial'
    makeDiscreteTrans: no visible global function definition for 'new'
    makeDiscreteTransInteger: no visible global function definition for
     'glm'
    makeDiscreteTransInteger: no visible binding for global variable
     'binomial'
    makeDiscreteTransInteger: no visible global function definition for
     'new'
    makeEnvObj: no visible global function definition for 'new'
    makeFecObj: no visible global function definition for 'new'
    makeFecObj: no visible global function definition for 'glm'
    makeFecObj: no visible global function definition for 'lm'
    makeFecObjInteger: no visible global function definition for 'new'
    makeFecObjInteger: no visible global function definition for 'glm'
    makeGrowthObj: no visible global function definition for 'lm'
    makeGrowthObj: no visible binding for global variable 'na.omit'
    makeGrowthObj: no visible global function definition for 'glm'
    makeGrowthObj: no visible global function definition for 'new'
    makeIPMFmatrix: no visible global function definition for 'runif'
    makeIPMFmatrix: no visible global function definition for 'new'
    makeIPMPmatrix: no visible global function definition for 'new'
    makeIPMPmatrix: no visible global function definition for 'predict'
    makeIPMPmatrix: no visible global function definition for 'dnorm'
    makeIntegerFmatrix: no visible global function definition for 'runif'
    makeIntegerFmatrix: no visible global function definition for 'new'
    makeIntegerPmatrix: no visible global function definition for 'new'
    makeIntegerPmatrix: no visible global function definition for 'predict'
    makeIntegerPmatrix: no visible global function definition for 'dpois'
    makeIntegerPmatrix: no visible global function definition for 'dnbinom'
    makeOffspringObj: no visible global function definition for 'lm'
    makeOffspringObj: no visible binding for global variable 'na.omit'
    makeOffspringObj: no visible global function definition for 'glm'
    makeOffspringObj: no visible global function definition for 'new'
    makeSurvObj: no visible global function definition for 'glm'
    makeSurvObj: no visible binding for global variable 'binomial'
    makeSurvObj: no visible global function definition for 'new'
    makegrowthObjHossfeld: no visible global function definition for
     'optim'
    makegrowthObjHossfeld: no visible global function definition for 'new'
    makegrowthObjHossfeld: no visible global function definition for 'sd'
    picGrow: no visible global function definition for 'plot'
    picGrow: no visible global function definition for 'abline'
    picGrow: no visible global function definition for 'points'
    picGrow: no visible global function definition for 'predict'
    picGrow: no visible global function definition for 'lines'
    picSurv: no visible global function definition for 'plot'
    picSurv: no visible global function definition for 'points'
    picSurv: no visible global function definition for 'predict'
    plotGrowthModelComp: no visible global function definition for 'plot'
    plotGrowthModelComp: no visible global function definition for 'terms'
    plotGrowthModelComp: no visible global function definition for
     'predict'
    plotGrowthModelComp: no visible global function definition for 'lines'
    plotGrowthModelComp: no visible global function definition for 'legend'
    plotSurvModelComp: no visible global function definition for 'plot'
    plotSurvModelComp: no visible global function definition for 'terms'
    plotSurvModelComp: no visible global function definition for 'lines'
    plotSurvModelComp: no visible global function definition for 'legend'
    predictFutureDistribution: no visible global function definition for
     'plot'
    predictFutureDistribution: no visible global function definition for
     'points'
    predictFutureDistribution: no visible global function definition for
     'legend'
    sampleIPMOutput: no visible global function definition for 'median'
    sampleVitalRateObj: no visible global function definition for
     'rdirichlet'
    sampleVitalRateObj: no visible global function definition for 'rmvnorm'
    sampleVitalRateObj: no visible global function definition for 'vcov'
    sampleVitalRateObj: no visible global function definition for 'rnorm'
    sampleVitalRateObj: no visible global function definition for
     'coefficients'
    simulateCarlina: no visible global function definition for 'rnorm'
    simulateCarlina: no visible global function definition for 'rmvnorm'
    simulateCarlina: no visible global function definition for 'runif'
    simulateCarlina: no visible global function definition for 'var'
    sizeToAge: no visible global function definition for 'median'
    timeToSize: no visible global function definition for 'par'
    timeToSize: no visible global function definition for 'plot'
    timeToSize: no visible global function definition for 'points'
    timeToSize: no visible global function definition for 'legend'
    timeToSize: no visible global function definition for 'abline'
    timeToSize: no visible global function definition for 'contour'
    growth,numeric-numeric-data.frame-growthObj: no visible global function
     definition for 'predict'
    growth,numeric-numeric-data.frame-growthObj: no visible global function
     definition for 'dnorm'
    growth,numeric-numeric-data.frame-growthObjDeclineVar: no visible
     global function definition for 'dnorm'
    growth,numeric-numeric-data.frame-growthObjHossfeld: no visible global
     function definition for 'dnorm'
    growth,numeric-numeric-data.frame-growthObjIncr: no visible global
     function definition for 'predict'
    growth,numeric-numeric-data.frame-growthObjIncr: no visible global
     function definition for 'dnorm'
    growth,numeric-numeric-data.frame-growthObjIncrDeclineVar: no visible
     global function definition for 'dnorm'
    growth,numeric-numeric-data.frame-growthObjLogIncr: no visible global
     function definition for 'predict'
    growth,numeric-numeric-data.frame-growthObjLogIncr: no visible global
     function definition for 'dlnorm'
    growth,numeric-numeric-data.frame-growthObjLogIncrDeclineVar: no
     visible global function definition for 'dlnorm'
    growth,numeric-numeric-data.frame-growthObjNegBin: no visible global
     function definition for 'predict'
    growth,numeric-numeric-data.frame-growthObjNegBin: no visible global
     function definition for 'dnbinom'
    growth,numeric-numeric-data.frame-growthObjPois: no visible global
     function definition for 'predict'
    growth,numeric-numeric-data.frame-growthObjPois: no visible global
     function definition for 'dpois'
    growth,numeric-numeric-data.frame-growthObjTruncIncr: no visible global
     function definition for 'dtruncnorm'
    growthCum,numeric-numeric-data.frame-growthObj: no visible global
     function definition for 'predict'
    growthCum,numeric-numeric-data.frame-growthObj: no visible global
     function definition for 'pnorm'
    growthCum,numeric-numeric-data.frame-growthObjDeclineVar: no visible
     global function definition for 'pnorm'
    growthCum,numeric-numeric-data.frame-growthObjHossfeld: no visible
     global function definition for 'pnorm'
    growthCum,numeric-numeric-data.frame-growthObjIncr: no visible global
     function definition for 'predict'
    growthCum,numeric-numeric-data.frame-growthObjIncr: no visible global
     function definition for 'pnorm'
    growthCum,numeric-numeric-data.frame-growthObjIncrDeclineVar: no
     visible global function definition for 'pnorm'
    growthCum,numeric-numeric-data.frame-growthObjLogIncr: no visible
     global function definition for 'predict'
    growthCum,numeric-numeric-data.frame-growthObjLogIncr: no visible
     global function definition for 'plnorm'
    growthCum,numeric-numeric-data.frame-growthObjLogIncrDeclineVar: no
     visible global function definition for 'plnorm'
    growthCum,numeric-numeric-data.frame-growthObjTruncIncr: no visible
     global function definition for 'ptruncnorm'
    surv,numeric-data.frame-survObj: no visible global function definition
     for 'predict'
    surv,numeric-data.frame-survObjOverDisp: no visible global function
     definition for 'predict'
    Undefined global functions or variables:
     abline arrows axis binomial coefficients contour dlnorm dnbinom dnorm
     dpois dtruncnorm glm hist legend lines lm matplot median mtext
     na.omit new optim par plnorm plot pnorm points predict ptruncnorm
     quantile rbinom rdirichlet rmvnorm rnorm runif sd terms text title
     var vcov
    Consider adding
     importFrom("graphics", "abline", "arrows", "axis", "contour", "hist",
     "legend", "lines", "matplot", "mtext", "par", "plot",
     "points", "text", "title")
     importFrom("methods", "new")
     importFrom("stats", "binomial", "coefficients", "dlnorm", "dnbinom",
     "dnorm", "dpois", "glm", "lm", "median", "na.omit", "optim",
     "plnorm", "pnorm", "predict", "quantile", "rbinom", "rnorm",
     "runif", "sd", "terms", "var", "vcov")
    to your NAMESPACE file (and ensure that your DESCRIPTION Imports field
    contains 'methods').
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64

Version: 2.1
Check: examples
Result: ERROR
    Running examples in 'IPMpack-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: R0Calc
    > ### Title: Calculates net reproductive rate (R0) from an IPM.
    > ### Aliases: R0Calc
    >
    > ### ** Examples
    >
    > dff <- generateData()
    > Pmatrix <- makeIPMPmatrix(minSize = min(dff$size, na.rm = TRUE),
    + maxSize = max(dff$size, na.rm = TRUE), growObj = makeGrowthObj(dff),
    + survObj = makeSurvObj(dff), correction="constant")
    > Fmatrix <- makeIPMFmatrix(minSize = min(dff$size, na.rm = TRUE),
    + maxSize = max(dff$size, na.rm = TRUE),
    + fecObj = makeFecObj(dff,Formula=fec~size), correction="constant")
    Error in split.default(X, group) : first argument must be a vector
    Calls: makeIPMFmatrix -> makeFecObj -> tapply -> split -> split.default
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 2.1
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
     ...
    --- re-building 'IPMpack_Vignette.Rnw' using Sweave
    Loading required package: Matrix
    Loading required package: MASS
    Loading required package: nlme
    
    Error: processing vignette 'IPMpack_Vignette.Rnw' failed with diagnostics:
     chunk 19
    Error in split.default(X, group) : first argument must be a vector
    
    --- failed re-building 'IPMpack_Vignette.Rnw'
    
    SUMMARY: processing the following file failed:
     'IPMpack_Vignette.Rnw'
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 2.1
Check: examples
Result: ERROR
    Running examples in ‘IPMpack-Ex.R’ failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: dataIPMpackHypericum
    > ### Title: Hypericum Perennial Dataset
    > ### Aliases: dataIPMpackHypericum
    > ### Keywords: datasets
    >
    > ### ** Examples
    >
    >
    > #Access data from the long-term censuses on Hypericum cumulicula
    > # carried out by Eric Menges, Pedro Quintana-Ascencio and coworkers
    > # at Archbold Biological Station. Here only a subset of individuals
    > # from population 'bald 1' and for the annual transition '1997-1998' are shown.
    > data("dataIPMpackHypericum")
    > d<-dataIPMpackHypericum
    >
    > #Variables are:
    > #id: unique identifier for each individual
    > #bald: population. Here only bald 1
    > #year: annual transition of the long-term data. Here only 1997-1998
    > #surv: survival (1) or not (0) of individuals between 1997 and 1998
    > #size: maximum height of the stems of each individual
    > #ontogeny: because the demography of Hypericum is very dynamic
    > # (turnover is very high) the experimental design described
    > # in Quintana-Ascencio et al. (2003) consists on establishing
    > # new permanent plots every year at each population,
    > # in addition to censusing old plots. Here we differentiate
    > # between individuals that appear for the first time in time t
    > # because they were recruits (1) and those that, not being new
    > # recruits, where measured for the first time in t because they
    > # were in a new permanent plot.
    > #fec0: probability of flowering (1) or not (0)
    > #fec1: number of fruits per individual
    > #sizeNext: same as "size" above, for t+1
    > #stageNext: same as "stage" above, for t+1
    >
    > #Due to the sampling design described above, here we consider only
    > # individual with a certain recruit origin:
    > d <- subset(d,is.na(d$size)==FALSE | d$ontogenyNext==1)
    >
    > #Side-experiments revealed that the following vital rates are size-independent
    > # and equal to:
    > #Number of seeds produced per fruit
    > fec2<-13.78
    > #Probability of seedling establishment
    > fec3<-0.001336
    > #Probability of seedling survival half a year after germinating,
    > # corresponding to the next annual census
    > fec4<-0.14
    > #Probability of a seed going into the seed bank
    > goSB<-0.08234528
    > #Probability of a seed staying in the seed bank
    > staySB<-0.672
    > #Note that the aforementioned vital rates are function of time since last fire,
    > #but because here we are only dealing with one population and one year
    > #transition, we treat them as constants. See Quintana-Ascencio et al (2003)
    > #for more information.
    >
    > #A simple re-organization of the data, getting rid of non-critical information
    > d<-d[,c("surv","size","sizeNext","fec0","fec1")]
    >
    > #The following states the continuous (max height of individual plant)
    > #part of the IPM. Note that the IPM to be constructed here contains a
    > #discrete stage: seedbank.
    > d$stageNext<-d$stage<-"continuous"
    > d$stage[is.na(d$size)]<-NA
    > #If individual did not survive, it is labelled as dead to t+1.
    > d$stageNext[d$surv==0]<-"dead"
    > #Adds probability of seeds going into (continuous -> seedbank),
    > #staying (seedbank -> seedbank) and leaving (continuous -> seedbank)
    > #the discrete stage.
    > d$number<-1
    > d$stage<-as.factor(d$stage)
    > d$stageNext<-as.factor(d$stageNext)
    >
    > #Carry out comparisons to establish the best survival model
    > testSurv <- survModelComp(d, expVars = c(surv~1, surv~size,
    + surv~size + size2), testType = "AIC",makePlot = TRUE,legendPos = "bottomleft")
    >
    > #Carry out comparisons to establish the best growth model
    > testGrow <- growthModelComp(d,expVars = c(sizeNext~1, sizeNext~size,
    + sizeNext~size + size2), regressionType = "constantVar",
    + testType = "AIC", makePlot = TRUE, legendPos = "bottomright")
    >
    > #Create survival object using regression model indicated by testSurv
    > so <- makeSurvObj(d, Formula = surv~size + size2)
    > picSurv(d,so)
    >
    > #Create growth object using regression model indicated by testGrown
    > go<-makeGrowthObj(d, Formula = sizeNext~size)
    > picGrow(d,go)
    > abline(a=0,b=1,lty=2)
    >
    > #Create fecundity object using regression models
    > fo <- makeFecObj(d, Formula=c(fec0~size, fec1~size),
    + Family=c("binomial","poisson"),
    + Transform=c("none", "none"),
    + meanOffspringSize=mean(d[is.na(d$size)==TRUE &
    + is.na(d$sizeNext)==FALSE,"sizeNext"]),
    + sdOffspringSize=sd(d[is.na(d$size)==TRUE &
    + is.na(d$sizeNext)==FALSE,"sizeNext"]),
    + fecConstants=data.frame(fec2=fec2,fec3=fec3,fec4=fec4),
    + offspringSplitter=data.frame(seedbank=goSB,
    + continuous=(1-goSB)),
    + vitalRatesPerOffspringType=data.frame(seedbank=c(1,1,1,0,0),
    + continuous=c(1,1,1,1,1),
    + row.names=c("fec0","fec1",
    + "fec2","fec3","fec4")))
    [1] "Warning - the variable names in your offspringSplitter data.frame are not all part of the levels of stage or stageNext in your data file. This could be because of an mismatch in stage names, or because you included discrete stages in offspringSplitter that are not in the data file but wchich you will introduce in makeDiscreteTrans (in which case you can ignore this warning)."
    >
    >
    > #Define discrete transition matrix
    > dto<-makeDiscreteTrans(d,
    + discreteTrans = matrix(c(staySB,(1-staySB)*fec3*fec4,
    + (1-staySB)*(1-fec3*fec4),0,
    + sum(d$number[d$stage=="continuous"&d$stageNext=="continuous"],
    + na.rm=TRUE),sum(d$number[d$stage=="continuous"&d$stageNext=="dead"],
    + na.rm=TRUE)),ncol=2,nrow=3,
    + dimnames=list(c("seedbank","continuous","dead"),
    + c("seedbank","continuous"))),
    + meanToCont = matrix(mean(d$sizeNext[is.na(d$stage)&
    + d$stageNext=="continuous"]),ncol=1,nrow=1,dimnames=list(c("mean"),
    + c("seedbank"))),
    + sdToCont = matrix(sd(d$sizeNext[is.na(d$stage)&
    + d$stageNext=="continuous"]),ncol=1,nrow=1,dimnames=list(c(""),
    + c("seedbank"))))
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    IPMpack
     --- call from context ---
    makeDiscreteTrans(d, discreteTrans = matrix(c(staySB, (1 - staySB) *
     fec3 * fec4, (1 - staySB) * (1 - fec3 * fec4), 0, sum(d$number[d$stage ==
     "continuous" & d$stageNext == "continuous"], na.rm = TRUE),
     sum(d$number[d$stage == "continuous" & d$stageNext == "dead"],
     na.rm = TRUE)), ncol = 2, nrow = 3, dimnames = list(c("seedbank",
     "continuous", "dead"), c("seedbank", "continuous"))), meanToCont = matrix(mean(d$sizeNext[is.na(d$stage) &
     d$stageNext == "continuous"]), ncol = 1, nrow = 1, dimnames = list(c("mean"),
     c("seedbank"))), sdToCont = matrix(sd(d$sizeNext[is.na(d$stage) &
     d$stageNext == "continuous"]), ncol = 1, nrow = 1, dimnames = list(c(""),
     c("seedbank"))))
     --- call from argument ---
    if (class(discreteTrans) != "matrix") stop("Error - the discreteTrans you entered should be a matrix")
     --- R stacktrace ---
    where 1: makeDiscreteTrans(d, discreteTrans = matrix(c(staySB, (1 - staySB) *
     fec3 * fec4, (1 - staySB) * (1 - fec3 * fec4), 0, sum(d$number[d$stage ==
     "continuous" & d$stageNext == "continuous"], na.rm = TRUE),
     sum(d$number[d$stage == "continuous" & d$stageNext == "dead"],
     na.rm = TRUE)), ncol = 2, nrow = 3, dimnames = list(c("seedbank",
     "continuous", "dead"), c("seedbank", "continuous"))), meanToCont = matrix(mean(d$sizeNext[is.na(d$stage) &
     d$stageNext == "continuous"]), ncol = 1, nrow = 1, dimnames = list(c("mean"),
     c("seedbank"))), sdToCont = matrix(sd(d$sizeNext[is.na(d$stage) &
     d$stageNext == "continuous"]), ncol = 1, nrow = 1, dimnames = list(c(""),
     c("seedbank"))))
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (dataf, stages = NA, discreteTrans = NA, meanToCont = NA,
     sdToCont = NA, continuousToDiscreteExplanatoryVariables = "size")
    {
     if (is.na(stages[1])) {
     stages <- names(tapply(c(levels(dataf$stage), levels(dataf$stageNext)),
     c(levels(dataf$stage), levels(dataf$stageNext)),
     length))
     if (!is.na(discreteTrans[1]))
     stages <- c(stages, dimnames(discreteTrans)[[2]])
     }
     stages <- unique(stages)
     stages <- c(stages[!stages %in% c("continuous", "dead")],
     "continuous", "dead")
     if (length(stages) == 2)
     stop("Error - no discrete stages found. If no discrete stages are included in your data file, please specify them in the discreteTrans argument of the makeDiscreteTrans function.")
     if (("number" %in% names(dataf)) == FALSE)
     dataf$number <- 1
     nDiscreteClasses <- length(stages) - 2
     if (is.na(discreteTrans[1]) & length(discreteTrans) == 1) {
     discreteTrans <- matrix(0, nrow = nDiscreteClasses +
     2, ncol = nDiscreteClasses + 1, dimnames = list(stages,
     stages[1:(length(stages) - 1)]))
     for (j in stages[1:(length(stages) - 1)]) {
     for (i in stages) discreteTrans[i, j] <- sum(dataf[dataf$stage ==
     j & dataf$stageNext == i, ]$number, na.rm = TRUE)
     }
     }
     if (class(discreteTrans) != "matrix")
     stop("Error - the discreteTrans you entered should be a matrix")
     if (nrow(discreteTrans) != length(stages) | ncol(discreteTrans) !=
     (length(stages) - 1))
     stop("Error - the discreteTrans matrix you entered should be a square matrix with dimensions equal to the number of stages (including continuous)")
     if (sum(dimnames(discreteTrans)[[1]] == stages) < length(stages))
     stop("Error - the row names of your discreteTrans matrix should be in alphabetical order, with continuous being the last one")
     if (sum(dimnames(discreteTrans)[[2]] == stages[1:(length(stages) -
     1)]) < (length(stages) - 1))
     stop("Error - the column names of your discreteTrans matrix should be in alphabetical order, with continuous being the last one")
     for (j in stages[1:(length(stages) - 1)]) discreteTrans[,
     j] <- discreteTrans[, j]/sum(discreteTrans[, j], na.rm = TRUE)
     if (is.na(meanToCont[1]) & length(meanToCont) == 1) {
     meanToCont <- matrix(NA, nrow = 1, ncol = nDiscreteClasses,
     dimnames = list(1, stages[1:nDiscreteClasses]))
     for (j in stages[which(as.numeric(discreteTrans["continuous",
     1:nDiscreteClasses]) > 0)]) {
     meanToCont[, j] <- mean(dataf[dataf$stage == j &
     dataf$stageNext == "continuous", ]$sizeNext,
     na.rm = TRUE)
     }
     }
     if (class(meanToCont) != "matrix")
     stop("Error - the meanToCont matrix you entered should be a matrix")
     if (nrow(meanToCont) != 1)
     stop("Error - the meanToCont matrix you entered should contain just 1 row with means (or NA's for those discrete stages from which no individuals move to the continuous class")
     if (sum(dimnames(meanToCont)[[2]] == stages[1:nDiscreteClasses]) <
     nDiscreteClasses)
     stop("Error - the column names of the meanToCont matrix you entered should be in alphabetical order and match the column names of the discrete classes in discreteTrans (so without continuous). If some of the discete stages are not mentioned in your data file, this error can be fixed by adding those stages first: levels(dataf$stage)<-c(levels(dataf$stage),<unmentioned_discrete_stages>)")
     if (is.na(sdToCont[1]) & length(sdToCont) == 1) {
     sdToCont <- matrix(NA, nrow = 1, ncol = nDiscreteClasses,
     dimnames = list(1, stages[1:nDiscreteClasses]))
     for (j in stages[which(as.numeric(discreteTrans["continuous",
     1:nDiscreteClasses]) > 0)]) {
     sdToCont[, j] <- sd(dataf[dataf$stage == j & dataf$stageNext ==
     "continuous", ]$sizeNext, na.rm = TRUE)
     }
     }
     if (class(sdToCont) != "matrix")
     stop("Error - the sdToCont matrix you entered should be a matrix")
     if (nrow(sdToCont) != 1)
     stop("Error - the sdToCont matrix you entered should contain just 1 row with means (or NA's for those discrete stages from which no individuals move to the continuous class")
     if (sum(dimnames(sdToCont)[[2]] == stages[1:nDiscreteClasses]) <
     nDiscreteClasses)
     stop("Error - the column names of the sdToCont matrix you entered should be in alphabetical order and match the column names of the discrete classes in discreteTrans (so without continuous). If some of the discete stages are not mentioned in your data file, this error can be fixed by adding those stages first: levels(dataf$stage)<-c(levels(dataf$stage),<unmentioned_discrete_stages>)")
     if (sum(discreteTrans[stages[1:nDiscreteClasses], "continuous"]) ==
     0) {
     moveToDiscrete <- glm(rep(0, 21) ~ 1, family = binomial)
     }
     else {
     subData <- subset(dataf, dataf$stage == "continuous" &
     dataf$surv == 1)
     subData$contToDiscrete <- 1
     subData$contToDiscrete[subData$stageNext == "continuous"] <- 0
     subData$size2 <- subData$size^2
     subData$size3 <- subData$size^3
     if (length(grep("expsize", as.character(continuousToDiscreteExplanatoryVariables))) >
     0)
     subData$expsize <- exp(subData$size)
     if (length(grep("logsize", as.character(continuousToDiscreteExplanatoryVariables))) >
     0)
     subData$logsize <- log(subData$size)
     moveToDiscrete <- glm(paste("contToDiscrete~", continuousToDiscreteExplanatoryVariables,
     sep = ""), family = binomial, data = subData)
     }
     disTrans <- new("discreteTrans")
     disTrans@discreteTrans <- discreteTrans
     disTrans@meanToCont <- meanToCont
     disTrans@sdToCont <- sdToCont
     disTrans@moveToDiscrete <- moveToDiscrete
     return(disTrans)
    }
    <bytecode: 0x55c22c4ad358>
    <environment: namespace:IPMpack>
     --- function search by body ---
    Function makeDiscreteTrans in namespace IPMpack has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(discreteTrans) != "matrix") stop("Error - the discreteTrans you entered should be a matrix") :
     the condition has length > 1
    Calls: makeDiscreteTrans
    Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 2.1
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
     ...
    --- re-building ‘IPMpack_Vignette.Rnw’ using Sweave
    Loading required package: Matrix
    Loading required package: MASS
    Loading required package: nlme
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    IPMpack
     --- call from context ---
    makeDiscreteTrans(dff)
     --- call from argument ---
    if (class(discreteTrans) != "matrix") stop("Error - the discreteTrans you entered should be a matrix")
     --- R stacktrace ---
    where 1: makeDiscreteTrans(dff)
    where 2: eval(expr, .GlobalEnv)
    where 3: eval(expr, .GlobalEnv)
    where 4: withVisible(eval(expr, .GlobalEnv))
    where 5: doTryCatch(return(expr), name, parentenv, handler)
    where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 7: tryCatchList(expr, classes, parentenv, handlers)
    where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 9: try(withVisible(eval(expr, .GlobalEnv)), silent = TRUE)
    where 10: evalFunc(ce, options)
    where 11: tryCatchList(expr, classes, parentenv, handlers)
    where 12: tryCatch(evalFunc(ce, options), finally = {
     cat("\n")
     sink()
    })
    where 13: driver$runcode(drobj, chunk, chunkopts)
    where 14: utils::Sweave(...)
    where 15: engine$weave(file, quiet = quiet, encoding = enc)
    where 16: doTryCatch(return(expr), name, parentenv, handler)
    where 17: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 18: tryCatchList(expr, classes, parentenv, handlers)
    where 19: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
     outputs <- c(outputs, output)
    }, error = function(e) {
     thisOK <<- FALSE
     fails <<- c(fails, file)
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 20: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-gcc/Work/PKGS/IPMpack.Rcheck/vign_test/IPMpack",
     ser_elibs = "/home/hornik/tmp/scratch/RtmpuD6crZ/file2eba74bd11fe.rds")
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (dataf, stages = NA, discreteTrans = NA, meanToCont = NA,
     sdToCont = NA, continuousToDiscreteExplanatoryVariables = "size")
    {
     if (is.na(stages[1])) {
     stages <- names(tapply(c(levels(dataf$stage), levels(dataf$stageNext)),
     c(levels(dataf$stage), levels(dataf$stageNext)),
     length))
     if (!is.na(discreteTrans[1]))
     stages <- c(stages, dimnames(discreteTrans)[[2]])
     }
     stages <- unique(stages)
     stages <- c(stages[!stages %in% c("continuous", "dead")],
     "continuous", "dead")
     if (length(stages) == 2)
     stop("Error - no discrete stages found. If no discrete stages are included in your data file, please specify them in the discreteTrans argument of the makeDiscreteTrans function.")
     if (("number" %in% names(dataf)) == FALSE)
     dataf$number <- 1
     nDiscreteClasses <- length(stages) - 2
     if (is.na(discreteTrans[1]) & length(discreteTrans) == 1) {
     discreteTrans <- matrix(0, nrow = nDiscreteClasses +
     2, ncol = nDiscreteClasses + 1, dimnames = list(stages,
     stages[1:(length(stages) - 1)]))
     for (j in stages[1:(length(stages) - 1)]) {
     for (i in stages) discreteTrans[i, j] <- sum(dataf[dataf$stage ==
     j & dataf$stageNext == i, ]$number, na.rm = TRUE)
     }
     }
     if (class(discreteTrans) != "matrix")
     stop("Error - the discreteTrans you entered should be a matrix")
     if (nrow(discreteTrans) != length(stages) | ncol(discreteTrans) !=
     (length(stages) - 1))
     stop("Error - the discreteTrans matrix you entered should be a square matrix with dimensions equal to the number of stages (including continuous)")
     if (sum(dimnames(discreteTrans)[[1]] == stages) < length(stages))
     stop("Error - the row names of your discreteTrans matrix should be in alphabetical order, with continuous being the last one")
     if (sum(dimnames(discreteTrans)[[2]] == stages[1:(length(stages) -
     1)]) < (length(stages) - 1))
     stop("Error - the column names of your discreteTrans matrix should be in alphabetical order, with continuous being the last one")
     for (j in stages[1:(length(stages) - 1)]) discreteTrans[,
     j] <- discreteTrans[, j]/sum(discreteTrans[, j], na.rm = TRUE)
     if (is.na(meanToCont[1]) & length(meanToCont) == 1) {
     meanToCont <- matrix(NA, nrow = 1, ncol = nDiscreteClasses,
     dimnames = list(1, stages[1:nDiscreteClasses]))
     for (j in stages[which(as.numeric(discreteTrans["continuous",
     1:nDiscreteClasses]) > 0)]) {
     meanToCont[, j] <- mean(dataf[dataf$stage == j &
     dataf$stageNext == "continuous", ]$sizeNext,
     na.rm = TRUE)
     }
     }
     if (class(meanToCont) != "matrix")
     stop("Error - the meanToCont matrix you entered should be a matrix")
     if (nrow(meanToCont) != 1)
     stop("Error - the meanToCont matrix you entered should contain just 1 row with means (or NA's for those discrete stages from which no individuals move to the continuous class")
     if (sum(dimnames(meanToCont)[[2]] == stages[1:nDiscreteClasses]) <
     nDiscreteClasses)
     stop("Error - the column names of the meanToCont matrix you entered should be in alphabetical order and match the column names of the discrete classes in discreteTrans (so without continuous). If some of the discete stages are not mentioned in your data file, this error can be fixed by adding those stages first: levels(dataf$stage)<-c(levels(dataf$stage),<unmentioned_discrete_stages>)")
     if (is.na(sdToCont[1]) & length(sdToCont) == 1) {
     sdToCont <- matrix(NA, nrow = 1, ncol = nDiscreteClasses,
     dimnames = list(1, stages[1:nDiscreteClasses]))
     for (j in stages[which(as.numeric(discreteTrans["continuous",
     1:nDiscreteClasses]) > 0)]) {
     sdToCont[, j] <- sd(dataf[dataf$stage == j & dataf$stageNext ==
     "continuous", ]$sizeNext, na.rm = TRUE)
     }
     }
     if (class(sdToCont) != "matrix")
     stop("Error - the sdToCont matrix you entered should be a matrix")
     if (nrow(sdToCont) != 1)
     stop("Error - the sdToCont matrix you entered should contain just 1 row with means (or NA's for those discrete stages from which no individuals move to the continuous class")
     if (sum(dimnames(sdToCont)[[2]] == stages[1:nDiscreteClasses]) <
     nDiscreteClasses)
     stop("Error - the column names of the sdToCont matrix you entered should be in alphabetical order and match the column names of the discrete classes in discreteTrans (so without continuous). If some of the discete stages are not mentioned in your data file, this error can be fixed by adding those stages first: levels(dataf$stage)<-c(levels(dataf$stage),<unmentioned_discrete_stages>)")
     if (sum(discreteTrans[stages[1:nDiscreteClasses], "continuous"]) ==
     0) {
     moveToDiscrete <- glm(rep(0, 21) ~ 1, family = binomial)
     }
     else {
     subData <- subset(dataf, dataf$stage == "continuous" &
     dataf$surv == 1)
     subData$contToDiscrete <- 1
     subData$contToDiscrete[subData$stageNext == "continuous"] <- 0
     subData$size2 <- subData$size^2
     subData$size3 <- subData$size^3
     if (length(grep("expsize", as.character(continuousToDiscreteExplanatoryVariables))) >
     0)
     subData$expsize <- exp(subData$size)
     if (length(grep("logsize", as.character(continuousToDiscreteExplanatoryVariables))) >
     0)
     subData$logsize <- log(subData$size)
     moveToDiscrete <- glm(paste("contToDiscrete~", continuousToDiscreteExplanatoryVariables,
     sep = ""), family = binomial, data = subData)
     }
     disTrans <- new("discreteTrans")
     disTrans@discreteTrans <- discreteTrans
     disTrans@meanToCont <- meanToCont
     disTrans@sdToCont <- sdToCont
     disTrans@moveToDiscrete <- moveToDiscrete
     return(disTrans)
    }
    <bytecode: 0x557bb99f5908>
    <environment: namespace:IPMpack>
     --- function search by body ---
    Function makeDiscreteTrans in namespace IPMpack has this body.
     ----------- END OF FAILURE REPORT --------------
    
    Error: processing vignette 'IPMpack_Vignette.Rnw' failed with diagnostics:
     chunk 30
    Error in if (class(discreteTrans) != "matrix") stop("Error - the discreteTrans you entered should be a matrix") :
     the condition has length > 1
    
    --- failed re-building ‘IPMpack_Vignette.Rnw’
    
    SUMMARY: processing the following file failed:
     ‘IPMpack_Vignette.Rnw’
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-debian-gcc

Version: 2.1
Check: examples
Result: ERROR
    Running examples in ‘IPMpack-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: dataIPMpackHypericum
    > ### Title: Hypericum Perennial Dataset
    > ### Aliases: dataIPMpackHypericum
    > ### Keywords: datasets
    >
    > ### ** Examples
    >
    >
    > #Access data from the long-term censuses on Hypericum cumulicula
    > # carried out by Eric Menges, Pedro Quintana-Ascencio and coworkers
    > # at Archbold Biological Station. Here only a subset of individuals
    > # from population 'bald 1' and for the annual transition '1997-1998' are shown.
    > data("dataIPMpackHypericum")
    > d<-dataIPMpackHypericum
    >
    > #Variables are:
    > #id: unique identifier for each individual
    > #bald: population. Here only bald 1
    > #year: annual transition of the long-term data. Here only 1997-1998
    > #surv: survival (1) or not (0) of individuals between 1997 and 1998
    > #size: maximum height of the stems of each individual
    > #ontogeny: because the demography of Hypericum is very dynamic
    > # (turnover is very high) the experimental design described
    > # in Quintana-Ascencio et al. (2003) consists on establishing
    > # new permanent plots every year at each population,
    > # in addition to censusing old plots. Here we differentiate
    > # between individuals that appear for the first time in time t
    > # because they were recruits (1) and those that, not being new
    > # recruits, where measured for the first time in t because they
    > # were in a new permanent plot.
    > #fec0: probability of flowering (1) or not (0)
    > #fec1: number of fruits per individual
    > #sizeNext: same as "size" above, for t+1
    > #stageNext: same as "stage" above, for t+1
    >
    > #Due to the sampling design described above, here we consider only
    > # individual with a certain recruit origin:
    > d <- subset(d,is.na(d$size)==FALSE | d$ontogenyNext==1)
    >
    > #Side-experiments revealed that the following vital rates are size-independent
    > # and equal to:
    > #Number of seeds produced per fruit
    > fec2<-13.78
    > #Probability of seedling establishment
    > fec3<-0.001336
    > #Probability of seedling survival half a year after germinating,
    > # corresponding to the next annual census
    > fec4<-0.14
    > #Probability of a seed going into the seed bank
    > goSB<-0.08234528
    > #Probability of a seed staying in the seed bank
    > staySB<-0.672
    > #Note that the aforementioned vital rates are function of time since last fire,
    > #but because here we are only dealing with one population and one year
    > #transition, we treat them as constants. See Quintana-Ascencio et al (2003)
    > #for more information.
    >
    > #A simple re-organization of the data, getting rid of non-critical information
    > d<-d[,c("surv","size","sizeNext","fec0","fec1")]
    >
    > #The following states the continuous (max height of individual plant)
    > #part of the IPM. Note that the IPM to be constructed here contains a
    > #discrete stage: seedbank.
    > d$stageNext<-d$stage<-"continuous"
    > d$stage[is.na(d$size)]<-NA
    > #If individual did not survive, it is labelled as dead to t+1.
    > d$stageNext[d$surv==0]<-"dead"
    > #Adds probability of seeds going into (continuous -> seedbank),
    > #staying (seedbank -> seedbank) and leaving (continuous -> seedbank)
    > #the discrete stage.
    > d$number<-1
    > d$stage<-as.factor(d$stage)
    > d$stageNext<-as.factor(d$stageNext)
    >
    > #Carry out comparisons to establish the best survival model
    > testSurv <- survModelComp(d, expVars = c(surv~1, surv~size,
    + surv~size + size2), testType = "AIC",makePlot = TRUE,legendPos = "bottomleft")
    >
    > #Carry out comparisons to establish the best growth model
    > testGrow <- growthModelComp(d,expVars = c(sizeNext~1, sizeNext~size,
    + sizeNext~size + size2), regressionType = "constantVar",
    + testType = "AIC", makePlot = TRUE, legendPos = "bottomright")
    >
    > #Create survival object using regression model indicated by testSurv
    > so <- makeSurvObj(d, Formula = surv~size + size2)
    > picSurv(d,so)
    >
    > #Create growth object using regression model indicated by testGrown
    > go<-makeGrowthObj(d, Formula = sizeNext~size)
    > picGrow(d,go)
    > abline(a=0,b=1,lty=2)
    >
    > #Create fecundity object using regression models
    > fo <- makeFecObj(d, Formula=c(fec0~size, fec1~size),
    + Family=c("binomial","poisson"),
    + Transform=c("none", "none"),
    + meanOffspringSize=mean(d[is.na(d$size)==TRUE &
    + is.na(d$sizeNext)==FALSE,"sizeNext"]),
    + sdOffspringSize=sd(d[is.na(d$size)==TRUE &
    + is.na(d$sizeNext)==FALSE,"sizeNext"]),
    + fecConstants=data.frame(fec2=fec2,fec3=fec3,fec4=fec4),
    + offspringSplitter=data.frame(seedbank=goSB,
    + continuous=(1-goSB)),
    + vitalRatesPerOffspringType=data.frame(seedbank=c(1,1,1,0,0),
    + continuous=c(1,1,1,1,1),
    + row.names=c("fec0","fec1",
    + "fec2","fec3","fec4")))
    [1] "Warning - the variable names in your offspringSplitter data.frame are not all part of the levels of stage or stageNext in your data file. This could be because of an mismatch in stage names, or because you included discrete stages in offspringSplitter that are not in the data file but wchich you will introduce in makeDiscreteTrans (in which case you can ignore this warning)."
    >
    >
    > #Define discrete transition matrix
    > dto<-makeDiscreteTrans(d,
    + discreteTrans = matrix(c(staySB,(1-staySB)*fec3*fec4,
    + (1-staySB)*(1-fec3*fec4),0,
    + sum(d$number[d$stage=="continuous"&d$stageNext=="continuous"],
    + na.rm=TRUE),sum(d$number[d$stage=="continuous"&d$stageNext=="dead"],
    + na.rm=TRUE)),ncol=2,nrow=3,
    + dimnames=list(c("seedbank","continuous","dead"),
    + c("seedbank","continuous"))),
    + meanToCont = matrix(mean(d$sizeNext[is.na(d$stage)&
    + d$stageNext=="continuous"]),ncol=1,nrow=1,dimnames=list(c("mean"),
    + c("seedbank"))),
    + sdToCont = matrix(sd(d$sizeNext[is.na(d$stage)&
    + d$stageNext=="continuous"]),ncol=1,nrow=1,dimnames=list(c(""),
    + c("seedbank"))))
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    IPMpack
     --- call from context ---
    makeDiscreteTrans(d, discreteTrans = matrix(c(staySB, (1 - staySB) *
     fec3 * fec4, (1 - staySB) * (1 - fec3 * fec4), 0, sum(d$number[d$stage ==
     "continuous" & d$stageNext == "continuous"], na.rm = TRUE),
     sum(d$number[d$stage == "continuous" & d$stageNext == "dead"],
     na.rm = TRUE)), ncol = 2, nrow = 3, dimnames = list(c("seedbank",
     "continuous", "dead"), c("seedbank", "continuous"))), meanToCont = matrix(mean(d$sizeNext[is.na(d$stage) &
     d$stageNext == "continuous"]), ncol = 1, nrow = 1, dimnames = list(c("mean"),
     c("seedbank"))), sdToCont = matrix(sd(d$sizeNext[is.na(d$stage) &
     d$stageNext == "continuous"]), ncol = 1, nrow = 1, dimnames = list(c(""),
     c("seedbank"))))
     --- call from argument ---
    if (class(discreteTrans) != "matrix") stop("Error - the discreteTrans you entered should be a matrix")
     --- R stacktrace ---
    where 1: makeDiscreteTrans(d, discreteTrans = matrix(c(staySB, (1 - staySB) *
     fec3 * fec4, (1 - staySB) * (1 - fec3 * fec4), 0, sum(d$number[d$stage ==
     "continuous" & d$stageNext == "continuous"], na.rm = TRUE),
     sum(d$number[d$stage == "continuous" & d$stageNext == "dead"],
     na.rm = TRUE)), ncol = 2, nrow = 3, dimnames = list(c("seedbank",
     "continuous", "dead"), c("seedbank", "continuous"))), meanToCont = matrix(mean(d$sizeNext[is.na(d$stage) &
     d$stageNext == "continuous"]), ncol = 1, nrow = 1, dimnames = list(c("mean"),
     c("seedbank"))), sdToCont = matrix(sd(d$sizeNext[is.na(d$stage) &
     d$stageNext == "continuous"]), ncol = 1, nrow = 1, dimnames = list(c(""),
     c("seedbank"))))
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (dataf, stages = NA, discreteTrans = NA, meanToCont = NA,
     sdToCont = NA, continuousToDiscreteExplanatoryVariables = "size")
    {
     if (is.na(stages[1])) {
     stages <- names(tapply(c(levels(dataf$stage), levels(dataf$stageNext)),
     c(levels(dataf$stage), levels(dataf$stageNext)),
     length))
     if (!is.na(discreteTrans[1]))
     stages <- c(stages, dimnames(discreteTrans)[[2]])
     }
     stages <- unique(stages)
     stages <- c(stages[!stages %in% c("continuous", "dead")],
     "continuous", "dead")
     if (length(stages) == 2)
     stop("Error - no discrete stages found. If no discrete stages are included in your data file, please specify them in the discreteTrans argument of the makeDiscreteTrans function.")
     if (("number" %in% names(dataf)) == FALSE)
     dataf$number <- 1
     nDiscreteClasses <- length(stages) - 2
     if (is.na(discreteTrans[1]) & length(discreteTrans) == 1) {
     discreteTrans <- matrix(0, nrow = nDiscreteClasses +
     2, ncol = nDiscreteClasses + 1, dimnames = list(stages,
     stages[1:(length(stages) - 1)]))
     for (j in stages[1:(length(stages) - 1)]) {
     for (i in stages) discreteTrans[i, j] <- sum(dataf[dataf$stage ==
     j & dataf$stageNext == i, ]$number, na.rm = TRUE)
     }
     }
     if (class(discreteTrans) != "matrix")
     stop("Error - the discreteTrans you entered should be a matrix")
     if (nrow(discreteTrans) != length(stages) | ncol(discreteTrans) !=
     (length(stages) - 1))
     stop("Error - the discreteTrans matrix you entered should be a square matrix with dimensions equal to the number of stages (including continuous)")
     if (sum(dimnames(discreteTrans)[[1]] == stages) < length(stages))
     stop("Error - the row names of your discreteTrans matrix should be in alphabetical order, with continuous being the last one")
     if (sum(dimnames(discreteTrans)[[2]] == stages[1:(length(stages) -
     1)]) < (length(stages) - 1))
     stop("Error - the column names of your discreteTrans matrix should be in alphabetical order, with continuous being the last one")
     for (j in stages[1:(length(stages) - 1)]) discreteTrans[,
     j] <- discreteTrans[, j]/sum(discreteTrans[, j], na.rm = TRUE)
     if (is.na(meanToCont[1]) & length(meanToCont) == 1) {
     meanToCont <- matrix(NA, nrow = 1, ncol = nDiscreteClasses,
     dimnames = list(1, stages[1:nDiscreteClasses]))
     for (j in stages[which(as.numeric(discreteTrans["continuous",
     1:nDiscreteClasses]) > 0)]) {
     meanToCont[, j] <- mean(dataf[dataf$stage == j &
     dataf$stageNext == "continuous", ]$sizeNext,
     na.rm = TRUE)
     }
     }
     if (class(meanToCont) != "matrix")
     stop("Error - the meanToCont matrix you entered should be a matrix")
     if (nrow(meanToCont) != 1)
     stop("Error - the meanToCont matrix you entered should contain just 1 row with means (or NA's for those discrete stages from which no individuals move to the continuous class")
     if (sum(dimnames(meanToCont)[[2]] == stages[1:nDiscreteClasses]) <
     nDiscreteClasses)
     stop("Error - the column names of the meanToCont matrix you entered should be in alphabetical order and match the column names of the discrete classes in discreteTrans (so without continuous). If some of the discete stages are not mentioned in your data file, this error can be fixed by adding those stages first: levels(dataf$stage)<-c(levels(dataf$stage),<unmentioned_discrete_stages>)")
     if (is.na(sdToCont[1]) & length(sdToCont) == 1) {
     sdToCont <- matrix(NA, nrow = 1, ncol = nDiscreteClasses,
     dimnames = list(1, stages[1:nDiscreteClasses]))
     for (j in stages[which(as.numeric(discreteTrans["continuous",
     1:nDiscreteClasses]) > 0)]) {
     sdToCont[, j] <- sd(dataf[dataf$stage == j & dataf$stageNext ==
     "continuous", ]$sizeNext, na.rm = TRUE)
     }
     }
     if (class(sdToCont) != "matrix")
     stop("Error - the sdToCont matrix you entered should be a matrix")
     if (nrow(sdToCont) != 1)
     stop("Error - the sdToCont matrix you entered should contain just 1 row with means (or NA's for those discrete stages from which no individuals move to the continuous class")
     if (sum(dimnames(sdToCont)[[2]] == stages[1:nDiscreteClasses]) <
     nDiscreteClasses)
     stop("Error - the column names of the sdToCont matrix you entered should be in alphabetical order and match the column names of the discrete classes in discreteTrans (so without continuous). If some of the discete stages are not mentioned in your data file, this error can be fixed by adding those stages first: levels(dataf$stage)<-c(levels(dataf$stage),<unmentioned_discrete_stages>)")
     if (sum(discreteTrans[stages[1:nDiscreteClasses], "continuous"]) ==
     0) {
     moveToDiscrete <- glm(rep(0, 21) ~ 1, family = binomial)
     }
     else {
     subData <- subset(dataf, dataf$stage == "continuous" &
     dataf$surv == 1)
     subData$contToDiscrete <- 1
     subData$contToDiscrete[subData$stageNext == "continuous"] <- 0
     subData$size2 <- subData$size^2
     subData$size3 <- subData$size^3
     if (length(grep("expsize", as.character(continuousToDiscreteExplanatoryVariables))) >
     0)
     subData$expsize <- exp(subData$size)
     if (length(grep("logsize", as.character(continuousToDiscreteExplanatoryVariables))) >
     0)
     subData$logsize <- log(subData$size)
     moveToDiscrete <- glm(paste("contToDiscrete~", continuousToDiscreteExplanatoryVariables,
     sep = ""), family = binomial, data = subData)
     }
     disTrans <- new("discreteTrans")
     disTrans@discreteTrans <- discreteTrans
     disTrans@meanToCont <- meanToCont
     disTrans@sdToCont <- sdToCont
     disTrans@moveToDiscrete <- moveToDiscrete
     return(disTrans)
    }
    <bytecode: 0xab60d98>
    <environment: namespace:IPMpack>
     --- function search by body ---
    Function makeDiscreteTrans in namespace IPMpack has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(discreteTrans) != "matrix") stop("Error - the discreteTrans you entered should be a matrix") :
     the condition has length > 1
    Calls: makeDiscreteTrans
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang

Version: 2.1
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
    --- re-building ‘IPMpack_Vignette.Rnw’ using Sweave
    Loading required package: Matrix
    Loading required package: MASS
    Loading required package: nlme
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    IPMpack
     --- call from context ---
    makeDiscreteTrans(dff)
     --- call from argument ---
    if (class(discreteTrans) != "matrix") stop("Error - the discreteTrans you entered should be a matrix")
     --- R stacktrace ---
    where 1: makeDiscreteTrans(dff)
    where 2: eval(expr, .GlobalEnv)
    where 3: eval(expr, .GlobalEnv)
    where 4: withVisible(eval(expr, .GlobalEnv))
    where 5: doTryCatch(return(expr), name, parentenv, handler)
    where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 7: tryCatchList(expr, classes, parentenv, handlers)
    where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 9: try(withVisible(eval(expr, .GlobalEnv)), silent = TRUE)
    where 10: evalFunc(ce, options)
    where 11: tryCatchList(expr, classes, parentenv, handlers)
    where 12: tryCatch(evalFunc(ce, options), finally = {
     cat("\n")
     sink()
    })
    where 13: driver$runcode(drobj, chunk, chunkopts)
    where 14: utils::Sweave(...)
    where 15: engine$weave(file, quiet = quiet, encoding = enc)
    where 16: doTryCatch(return(expr), name, parentenv, handler)
    where 17: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 18: tryCatchList(expr, classes, parentenv, handlers)
    where 19: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
     outputs <- c(outputs, output)
    }, error = function(e) {
     thisOK <<- FALSE
     fails <<- c(fails, file)
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 20: tools:::buildVignettes(dir = "/data/gannet/ripley/R/packages/tests-clang/IPMpack.Rcheck/vign_test/IPMpack",
     ser_elibs = "/tmp/RtmpRx4gbO/file57593d1154cd.rds")
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (dataf, stages = NA, discreteTrans = NA, meanToCont = NA,
     sdToCont = NA, continuousToDiscreteExplanatoryVariables = "size")
    {
     if (is.na(stages[1])) {
     stages <- names(tapply(c(levels(dataf$stage), levels(dataf$stageNext)),
     c(levels(dataf$stage), levels(dataf$stageNext)),
     length))
     if (!is.na(discreteTrans[1]))
     stages <- c(stages, dimnames(discreteTrans)[[2]])
     }
     stages <- unique(stages)
     stages <- c(stages[!stages %in% c("continuous", "dead")],
     "continuous", "dead")
     if (length(stages) == 2)
     stop("Error - no discrete stages found. If no discrete stages are included in your data file, please specify them in the discreteTrans argument of the makeDiscreteTrans function.")
     if (("number" %in% names(dataf)) == FALSE)
     dataf$number <- 1
     nDiscreteClasses <- length(stages) - 2
     if (is.na(discreteTrans[1]) & length(discreteTrans) == 1) {
     discreteTrans <- matrix(0, nrow = nDiscreteClasses +
     2, ncol = nDiscreteClasses + 1, dimnames = list(stages,
     stages[1:(length(stages) - 1)]))
     for (j in stages[1:(length(stages) - 1)]) {
     for (i in stages) discreteTrans[i, j] <- sum(dataf[dataf$stage ==
     j & dataf$stageNext == i, ]$number, na.rm = TRUE)
     }
     }
     if (class(discreteTrans) != "matrix")
     stop("Error - the discreteTrans you entered should be a matrix")
     if (nrow(discreteTrans) != length(stages) | ncol(discreteTrans) !=
     (length(stages) - 1))
     stop("Error - the discreteTrans matrix you entered should be a square matrix with dimensions equal to the number of stages (including continuous)")
     if (sum(dimnames(discreteTrans)[[1]] == stages) < length(stages))
     stop("Error - the row names of your discreteTrans matrix should be in alphabetical order, with continuous being the last one")
     if (sum(dimnames(discreteTrans)[[2]] == stages[1:(length(stages) -
     1)]) < (length(stages) - 1))
     stop("Error - the column names of your discreteTrans matrix should be in alphabetical order, with continuous being the last one")
     for (j in stages[1:(length(stages) - 1)]) discreteTrans[,
     j] <- discreteTrans[, j]/sum(discreteTrans[, j], na.rm = TRUE)
     if (is.na(meanToCont[1]) & length(meanToCont) == 1) {
     meanToCont <- matrix(NA, nrow = 1, ncol = nDiscreteClasses,
     dimnames = list(1, stages[1:nDiscreteClasses]))
     for (j in stages[which(as.numeric(discreteTrans["continuous",
     1:nDiscreteClasses]) > 0)]) {
     meanToCont[, j] <- mean(dataf[dataf$stage == j &
     dataf$stageNext == "continuous", ]$sizeNext,
     na.rm = TRUE)
     }
     }
     if (class(meanToCont) != "matrix")
     stop("Error - the meanToCont matrix you entered should be a matrix")
     if (nrow(meanToCont) != 1)
     stop("Error - the meanToCont matrix you entered should contain just 1 row with means (or NA's for those discrete stages from which no individuals move to the continuous class")
     if (sum(dimnames(meanToCont)[[2]] == stages[1:nDiscreteClasses]) <
     nDiscreteClasses)
     stop("Error - the column names of the meanToCont matrix you entered should be in alphabetical order and match the column names of the discrete classes in discreteTrans (so without continuous). If some of the discete stages are not mentioned in your data file, this error can be fixed by adding those stages first: levels(dataf$stage)<-c(levels(dataf$stage),<unmentioned_discrete_stages>)")
     if (is.na(sdToCont[1]) & length(sdToCont) == 1) {
     sdToCont <- matrix(NA, nrow = 1, ncol = nDiscreteClasses,
     dimnames = list(1, stages[1:nDiscreteClasses]))
     for (j in stages[which(as.numeric(discreteTrans["continuous",
     1:nDiscreteClasses]) > 0)]) {
     sdToCont[, j] <- sd(dataf[dataf$stage == j & dataf$stageNext ==
     "continuous", ]$sizeNext, na.rm = TRUE)
     }
     }
     if (class(sdToCont) != "matrix")
     stop("Error - the sdToCont matrix you entered should be a matrix")
     if (nrow(sdToCont) != 1)
     stop("Error - the sdToCont matrix you entered should contain just 1 row with means (or NA's for those discrete stages from which no individuals move to the continuous class")
     if (sum(dimnames(sdToCont)[[2]] == stages[1:nDiscreteClasses]) <
     nDiscreteClasses)
     stop("Error - the column names of the sdToCont matrix you entered should be in alphabetical order and match the column names of the discrete classes in discreteTrans (so without continuous). If some of the discete stages are not mentioned in your data file, this error can be fixed by adding those stages first: levels(dataf$stage)<-c(levels(dataf$stage),<unmentioned_discrete_stages>)")
     if (sum(discreteTrans[stages[1:nDiscreteClasses], "continuous"]) ==
     0) {
     moveToDiscrete <- glm(rep(0, 21) ~ 1, family = binomial)
     }
     else {
     subData <- subset(dataf, dataf$stage == "continuous" &
     dataf$surv == 1)
     subData$contToDiscrete <- 1
     subData$contToDiscrete[subData$stageNext == "continuous"] <- 0
     subData$size2 <- subData$size^2
     subData$size3 <- subData$size^3
     if (length(grep("expsize", as.character(continuousToDiscreteExplanatoryVariables))) >
     0)
     subData$expsize <- exp(subData$size)
     if (length(grep("logsize", as.character(continuousToDiscreteExplanatoryVariables))) >
     0)
     subData$logsize <- log(subData$size)
     moveToDiscrete <- glm(paste("contToDiscrete~", continuousToDiscreteExplanatoryVariables,
     sep = ""), family = binomial, data = subData)
     }
     disTrans <- new("discreteTrans")
     disTrans@discreteTrans <- discreteTrans
     disTrans@meanToCont <- meanToCont
     disTrans@sdToCont <- sdToCont
     disTrans@moveToDiscrete <- moveToDiscrete
     return(disTrans)
    }
    <bytecode: 0x5aecbc0>
    <environment: namespace:IPMpack>
     --- function search by body ---
    Function makeDiscreteTrans in namespace IPMpack has this body.
     ----------- END OF FAILURE REPORT --------------
    
    Error: processing vignette 'IPMpack_Vignette.Rnw' failed with diagnostics:
     chunk 30
    Error in if (class(discreteTrans) != "matrix") stop("Error - the discreteTrans you entered should be a matrix") :
     the condition has length > 1
    
    --- failed re-building ‘IPMpack_Vignette.Rnw’
    
    SUMMARY: processing the following file failed:
     ‘IPMpack_Vignette.Rnw’
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-clang

Version: 2.1
Check: examples
Result: ERROR
    Running examples in ‘IPMpack-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: dataIPMpackHypericum
    > ### Title: Hypericum Perennial Dataset
    > ### Aliases: dataIPMpackHypericum
    > ### Keywords: datasets
    >
    > ### ** Examples
    >
    >
    > #Access data from the long-term censuses on Hypericum cumulicula
    > # carried out by Eric Menges, Pedro Quintana-Ascencio and coworkers
    > # at Archbold Biological Station. Here only a subset of individuals
    > # from population 'bald 1' and for the annual transition '1997-1998' are shown.
    > data("dataIPMpackHypericum")
    > d<-dataIPMpackHypericum
    >
    > #Variables are:
    > #id: unique identifier for each individual
    > #bald: population. Here only bald 1
    > #year: annual transition of the long-term data. Here only 1997-1998
    > #surv: survival (1) or not (0) of individuals between 1997 and 1998
    > #size: maximum height of the stems of each individual
    > #ontogeny: because the demography of Hypericum is very dynamic
    > # (turnover is very high) the experimental design described
    > # in Quintana-Ascencio et al. (2003) consists on establishing
    > # new permanent plots every year at each population,
    > # in addition to censusing old plots. Here we differentiate
    > # between individuals that appear for the first time in time t
    > # because they were recruits (1) and those that, not being new
    > # recruits, where measured for the first time in t because they
    > # were in a new permanent plot.
    > #fec0: probability of flowering (1) or not (0)
    > #fec1: number of fruits per individual
    > #sizeNext: same as "size" above, for t+1
    > #stageNext: same as "stage" above, for t+1
    >
    > #Due to the sampling design described above, here we consider only
    > # individual with a certain recruit origin:
    > d <- subset(d,is.na(d$size)==FALSE | d$ontogenyNext==1)
    >
    > #Side-experiments revealed that the following vital rates are size-independent
    > # and equal to:
    > #Number of seeds produced per fruit
    > fec2<-13.78
    > #Probability of seedling establishment
    > fec3<-0.001336
    > #Probability of seedling survival half a year after germinating,
    > # corresponding to the next annual census
    > fec4<-0.14
    > #Probability of a seed going into the seed bank
    > goSB<-0.08234528
    > #Probability of a seed staying in the seed bank
    > staySB<-0.672
    > #Note that the aforementioned vital rates are function of time since last fire,
    > #but because here we are only dealing with one population and one year
    > #transition, we treat them as constants. See Quintana-Ascencio et al (2003)
    > #for more information.
    >
    > #A simple re-organization of the data, getting rid of non-critical information
    > d<-d[,c("surv","size","sizeNext","fec0","fec1")]
    >
    > #The following states the continuous (max height of individual plant)
    > #part of the IPM. Note that the IPM to be constructed here contains a
    > #discrete stage: seedbank.
    > d$stageNext<-d$stage<-"continuous"
    > d$stage[is.na(d$size)]<-NA
    > #If individual did not survive, it is labelled as dead to t+1.
    > d$stageNext[d$surv==0]<-"dead"
    > #Adds probability of seeds going into (continuous -> seedbank),
    > #staying (seedbank -> seedbank) and leaving (continuous -> seedbank)
    > #the discrete stage.
    > d$number<-1
    > d$stage<-as.factor(d$stage)
    > d$stageNext<-as.factor(d$stageNext)
    >
    > #Carry out comparisons to establish the best survival model
    > testSurv <- survModelComp(d, expVars = c(surv~1, surv~size,
    + surv~size + size2), testType = "AIC",makePlot = TRUE,legendPos = "bottomleft")
    >
    > #Carry out comparisons to establish the best growth model
    > testGrow <- growthModelComp(d,expVars = c(sizeNext~1, sizeNext~size,
    + sizeNext~size + size2), regressionType = "constantVar",
    + testType = "AIC", makePlot = TRUE, legendPos = "bottomright")
    >
    > #Create survival object using regression model indicated by testSurv
    > so <- makeSurvObj(d, Formula = surv~size + size2)
    > picSurv(d,so)
    >
    > #Create growth object using regression model indicated by testGrown
    > go<-makeGrowthObj(d, Formula = sizeNext~size)
    > picGrow(d,go)
    > abline(a=0,b=1,lty=2)
    >
    > #Create fecundity object using regression models
    > fo <- makeFecObj(d, Formula=c(fec0~size, fec1~size),
    + Family=c("binomial","poisson"),
    + Transform=c("none", "none"),
    + meanOffspringSize=mean(d[is.na(d$size)==TRUE &
    + is.na(d$sizeNext)==FALSE,"sizeNext"]),
    + sdOffspringSize=sd(d[is.na(d$size)==TRUE &
    + is.na(d$sizeNext)==FALSE,"sizeNext"]),
    + fecConstants=data.frame(fec2=fec2,fec3=fec3,fec4=fec4),
    + offspringSplitter=data.frame(seedbank=goSB,
    + continuous=(1-goSB)),
    + vitalRatesPerOffspringType=data.frame(seedbank=c(1,1,1,0,0),
    + continuous=c(1,1,1,1,1),
    + row.names=c("fec0","fec1",
    + "fec2","fec3","fec4")))
    [1] "Warning - the variable names in your offspringSplitter data.frame are not all part of the levels of stage or stageNext in your data file. This could be because of an mismatch in stage names, or because you included discrete stages in offspringSplitter that are not in the data file but wchich you will introduce in makeDiscreteTrans (in which case you can ignore this warning)."
    >
    >
    > #Define discrete transition matrix
    > dto<-makeDiscreteTrans(d,
    + discreteTrans = matrix(c(staySB,(1-staySB)*fec3*fec4,
    + (1-staySB)*(1-fec3*fec4),0,
    + sum(d$number[d$stage=="continuous"&d$stageNext=="continuous"],
    + na.rm=TRUE),sum(d$number[d$stage=="continuous"&d$stageNext=="dead"],
    + na.rm=TRUE)),ncol=2,nrow=3,
    + dimnames=list(c("seedbank","continuous","dead"),
    + c("seedbank","continuous"))),
    + meanToCont = matrix(mean(d$sizeNext[is.na(d$stage)&
    + d$stageNext=="continuous"]),ncol=1,nrow=1,dimnames=list(c("mean"),
    + c("seedbank"))),
    + sdToCont = matrix(sd(d$sizeNext[is.na(d$stage)&
    + d$stageNext=="continuous"]),ncol=1,nrow=1,dimnames=list(c(""),
    + c("seedbank"))))
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    IPMpack
     --- call from context ---
    makeDiscreteTrans(d, discreteTrans = matrix(c(staySB, (1 - staySB) *
     fec3 * fec4, (1 - staySB) * (1 - fec3 * fec4), 0, sum(d$number[d$stage ==
     "continuous" & d$stageNext == "continuous"], na.rm = TRUE),
     sum(d$number[d$stage == "continuous" & d$stageNext == "dead"],
     na.rm = TRUE)), ncol = 2, nrow = 3, dimnames = list(c("seedbank",
     "continuous", "dead"), c("seedbank", "continuous"))), meanToCont = matrix(mean(d$sizeNext[is.na(d$stage) &
     d$stageNext == "continuous"]), ncol = 1, nrow = 1, dimnames = list(c("mean"),
     c("seedbank"))), sdToCont = matrix(sd(d$sizeNext[is.na(d$stage) &
     d$stageNext == "continuous"]), ncol = 1, nrow = 1, dimnames = list(c(""),
     c("seedbank"))))
     --- call from argument ---
    if (class(discreteTrans) != "matrix") stop("Error - the discreteTrans you entered should be a matrix")
     --- R stacktrace ---
    where 1: makeDiscreteTrans(d, discreteTrans = matrix(c(staySB, (1 - staySB) *
     fec3 * fec4, (1 - staySB) * (1 - fec3 * fec4), 0, sum(d$number[d$stage ==
     "continuous" & d$stageNext == "continuous"], na.rm = TRUE),
     sum(d$number[d$stage == "continuous" & d$stageNext == "dead"],
     na.rm = TRUE)), ncol = 2, nrow = 3, dimnames = list(c("seedbank",
     "continuous", "dead"), c("seedbank", "continuous"))), meanToCont = matrix(mean(d$sizeNext[is.na(d$stage) &
     d$stageNext == "continuous"]), ncol = 1, nrow = 1, dimnames = list(c("mean"),
     c("seedbank"))), sdToCont = matrix(sd(d$sizeNext[is.na(d$stage) &
     d$stageNext == "continuous"]), ncol = 1, nrow = 1, dimnames = list(c(""),
     c("seedbank"))))
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (dataf, stages = NA, discreteTrans = NA, meanToCont = NA,
     sdToCont = NA, continuousToDiscreteExplanatoryVariables = "size")
    {
     if (is.na(stages[1])) {
     stages <- names(tapply(c(levels(dataf$stage), levels(dataf$stageNext)),
     c(levels(dataf$stage), levels(dataf$stageNext)),
     length))
     if (!is.na(discreteTrans[1]))
     stages <- c(stages, dimnames(discreteTrans)[[2]])
     }
     stages <- unique(stages)
     stages <- c(stages[!stages %in% c("continuous", "dead")],
     "continuous", "dead")
     if (length(stages) == 2)
     stop("Error - no discrete stages found. If no discrete stages are included in your data file, please specify them in the discreteTrans argument of the makeDiscreteTrans function.")
     if (("number" %in% names(dataf)) == FALSE)
     dataf$number <- 1
     nDiscreteClasses <- length(stages) - 2
     if (is.na(discreteTrans[1]) & length(discreteTrans) == 1) {
     discreteTrans <- matrix(0, nrow = nDiscreteClasses +
     2, ncol = nDiscreteClasses + 1, dimnames = list(stages,
     stages[1:(length(stages) - 1)]))
     for (j in stages[1:(length(stages) - 1)]) {
     for (i in stages) discreteTrans[i, j] <- sum(dataf[dataf$stage ==
     j & dataf$stageNext == i, ]$number, na.rm = TRUE)
     }
     }
     if (class(discreteTrans) != "matrix")
     stop("Error - the discreteTrans you entered should be a matrix")
     if (nrow(discreteTrans) != length(stages) | ncol(discreteTrans) !=
     (length(stages) - 1))
     stop("Error - the discreteTrans matrix you entered should be a square matrix with dimensions equal to the number of stages (including continuous)")
     if (sum(dimnames(discreteTrans)[[1]] == stages) < length(stages))
     stop("Error - the row names of your discreteTrans matrix should be in alphabetical order, with continuous being the last one")
     if (sum(dimnames(discreteTrans)[[2]] == stages[1:(length(stages) -
     1)]) < (length(stages) - 1))
     stop("Error - the column names of your discreteTrans matrix should be in alphabetical order, with continuous being the last one")
     for (j in stages[1:(length(stages) - 1)]) discreteTrans[,
     j] <- discreteTrans[, j]/sum(discreteTrans[, j], na.rm = TRUE)
     if (is.na(meanToCont[1]) & length(meanToCont) == 1) {
     meanToCont <- matrix(NA, nrow = 1, ncol = nDiscreteClasses,
     dimnames = list(1, stages[1:nDiscreteClasses]))
     for (j in stages[which(as.numeric(discreteTrans["continuous",
     1:nDiscreteClasses]) > 0)]) {
     meanToCont[, j] <- mean(dataf[dataf$stage == j &
     dataf$stageNext == "continuous", ]$sizeNext,
     na.rm = TRUE)
     }
     }
     if (class(meanToCont) != "matrix")
     stop("Error - the meanToCont matrix you entered should be a matrix")
     if (nrow(meanToCont) != 1)
     stop("Error - the meanToCont matrix you entered should contain just 1 row with means (or NA's for those discrete stages from which no individuals move to the continuous class")
     if (sum(dimnames(meanToCont)[[2]] == stages[1:nDiscreteClasses]) <
     nDiscreteClasses)
     stop("Error - the column names of the meanToCont matrix you entered should be in alphabetical order and match the column names of the discrete classes in discreteTrans (so without continuous). If some of the discete stages are not mentioned in your data file, this error can be fixed by adding those stages first: levels(dataf$stage)<-c(levels(dataf$stage),<unmentioned_discrete_stages>)")
     if (is.na(sdToCont[1]) & length(sdToCont) == 1) {
     sdToCont <- matrix(NA, nrow = 1, ncol = nDiscreteClasses,
     dimnames = list(1, stages[1:nDiscreteClasses]))
     for (j in stages[which(as.numeric(discreteTrans["continuous",
     1:nDiscreteClasses]) > 0)]) {
     sdToCont[, j] <- sd(dataf[dataf$stage == j & dataf$stageNext ==
     "continuous", ]$sizeNext, na.rm = TRUE)
     }
     }
     if (class(sdToCont) != "matrix")
     stop("Error - the sdToCont matrix you entered should be a matrix")
     if (nrow(sdToCont) != 1)
     stop("Error - the sdToCont matrix you entered should contain just 1 row with means (or NA's for those discrete stages from which no individuals move to the continuous class")
     if (sum(dimnames(sdToCont)[[2]] == stages[1:nDiscreteClasses]) <
     nDiscreteClasses)
     stop("Error - the column names of the sdToCont matrix you entered should be in alphabetical order and match the column names of the discrete classes in discreteTrans (so without continuous). If some of the discete stages are not mentioned in your data file, this error can be fixed by adding those stages first: levels(dataf$stage)<-c(levels(dataf$stage),<unmentioned_discrete_stages>)")
     if (sum(discreteTrans[stages[1:nDiscreteClasses], "continuous"]) ==
     0) {
     moveToDiscrete <- glm(rep(0, 21) ~ 1, family = binomial)
     }
     else {
     subData <- subset(dataf, dataf$stage == "continuous" &
     dataf$surv == 1)
     subData$contToDiscrete <- 1
     subData$contToDiscrete[subData$stageNext == "continuous"] <- 0
     subData$size2 <- subData$size^2
     subData$size3 <- subData$size^3
     if (length(grep("expsize", as.character(continuousToDiscreteExplanatoryVariables))) >
     0)
     subData$expsize <- exp(subData$size)
     if (length(grep("logsize", as.character(continuousToDiscreteExplanatoryVariables))) >
     0)
     subData$logsize <- log(subData$size)
     moveToDiscrete <- glm(paste("contToDiscrete~", continuousToDiscreteExplanatoryVariables,
     sep = ""), family = binomial, data = subData)
     }
     disTrans <- new("discreteTrans")
     disTrans@discreteTrans <- discreteTrans
     disTrans@meanToCont <- meanToCont
     disTrans@sdToCont <- sdToCont
     disTrans@moveToDiscrete <- moveToDiscrete
     return(disTrans)
    }
    <bytecode: 0xaa5c3d0>
    <environment: namespace:IPMpack>
     --- function search by body ---
    Function makeDiscreteTrans in namespace IPMpack has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (class(discreteTrans) != "matrix") stop("Error - the discreteTrans you entered should be a matrix") :
     the condition has length > 1
    Calls: makeDiscreteTrans
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc

Version: 2.1
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
    --- re-building ‘IPMpack_Vignette.Rnw’ using Sweave
    Loading required package: Matrix
    Loading required package: MASS
    Loading required package: nlme
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    IPMpack
     --- call from context ---
    makeDiscreteTrans(dff)
     --- call from argument ---
    if (class(discreteTrans) != "matrix") stop("Error - the discreteTrans you entered should be a matrix")
     --- R stacktrace ---
    where 1: makeDiscreteTrans(dff)
    where 2: eval(expr, .GlobalEnv)
    where 3: eval(expr, .GlobalEnv)
    where 4: withVisible(eval(expr, .GlobalEnv))
    where 5: doTryCatch(return(expr), name, parentenv, handler)
    where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 7: tryCatchList(expr, classes, parentenv, handlers)
    where 8: tryCatch(expr, error = function(e) {
     call <- conditionCall(e)
     if (!is.null(call)) {
     if (identical(call[[1L]], quote(doTryCatch)))
     call <- sys.call(-4L)
     dcall <- deparse(call)[1L]
     prefix <- paste("Error in", dcall, ": ")
     LONG <- 75L
     sm <- strsplit(conditionMessage(e), "\n")[[1L]]
     w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
     if (is.na(w))
     w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],
     type = "b")
     if (w > LONG)
     prefix <- paste0(prefix, "\n ")
     }
     else prefix <- "Error : "
     msg <- paste0(prefix, conditionMessage(e), "\n")
     .Internal(seterrmessage(msg[1L]))
     if (!silent && isTRUE(getOption("show.error.messages"))) {
     cat(msg, file = outFile)
     .Internal(printDeferredWarnings())
     }
     invisible(structure(msg, class = "try-error", condition = e))
    })
    where 9: try(withVisible(eval(expr, .GlobalEnv)), silent = TRUE)
    where 10: evalFunc(ce, options)
    where 11: tryCatchList(expr, classes, parentenv, handlers)
    where 12: tryCatch(evalFunc(ce, options), finally = {
     cat("\n")
     sink()
    })
    where 13: driver$runcode(drobj, chunk, chunkopts)
    where 14: utils::Sweave(...)
    where 15: engine$weave(file, quiet = quiet, encoding = enc)
    where 16: doTryCatch(return(expr), name, parentenv, handler)
    where 17: tryCatchOne(expr, names, parentenv, handlers[[1L]])
    where 18: tryCatchList(expr, classes, parentenv, handlers)
    where 19: tryCatch({
     engine$weave(file, quiet = quiet, encoding = enc)
     setwd(startdir)
     output <- find_vignette_product(name, by = "weave", engine = engine)
     if (!have.makefile && vignette_is_tex(output)) {
     texi2pdf(file = output, clean = FALSE, quiet = quiet)
     output <- find_vignette_product(name, by = "texi2pdf",
     engine = engine)
     }
     outputs <- c(outputs, output)
    }, error = function(e) {
     thisOK <<- FALSE
     fails <<- c(fails, file)
     message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s",
     file, conditionMessage(e)))
    })
    where 20: tools:::buildVignettes(dir = "/data/gannet/ripley/R/packages/tests-devel/IPMpack.Rcheck/vign_test/IPMpack",
     ser_elibs = "/tmp/RtmpCQNbCk/file41f9d06e7b0.rds")
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (dataf, stages = NA, discreteTrans = NA, meanToCont = NA,
     sdToCont = NA, continuousToDiscreteExplanatoryVariables = "size")
    {
     if (is.na(stages[1])) {
     stages <- names(tapply(c(levels(dataf$stage), levels(dataf$stageNext)),
     c(levels(dataf$stage), levels(dataf$stageNext)),
     length))
     if (!is.na(discreteTrans[1]))
     stages <- c(stages, dimnames(discreteTrans)[[2]])
     }
     stages <- unique(stages)
     stages <- c(stages[!stages %in% c("continuous", "dead")],
     "continuous", "dead")
     if (length(stages) == 2)
     stop("Error - no discrete stages found. If no discrete stages are included in your data file, please specify them in the discreteTrans argument of the makeDiscreteTrans function.")
     if (("number" %in% names(dataf)) == FALSE)
     dataf$number <- 1
     nDiscreteClasses <- length(stages) - 2
     if (is.na(discreteTrans[1]) & length(discreteTrans) == 1) {
     discreteTrans <- matrix(0, nrow = nDiscreteClasses +
     2, ncol = nDiscreteClasses + 1, dimnames = list(stages,
     stages[1:(length(stages) - 1)]))
     for (j in stages[1:(length(stages) - 1)]) {
     for (i in stages) discreteTrans[i, j] <- sum(dataf[dataf$stage ==
     j & dataf$stageNext == i, ]$number, na.rm = TRUE)
     }
     }
     if (class(discreteTrans) != "matrix")
     stop("Error - the discreteTrans you entered should be a matrix")
     if (nrow(discreteTrans) != length(stages) | ncol(discreteTrans) !=
     (length(stages) - 1))
     stop("Error - the discreteTrans matrix you entered should be a square matrix with dimensions equal to the number of stages (including continuous)")
     if (sum(dimnames(discreteTrans)[[1]] == stages) < length(stages))
     stop("Error - the row names of your discreteTrans matrix should be in alphabetical order, with continuous being the last one")
     if (sum(dimnames(discreteTrans)[[2]] == stages[1:(length(stages) -
     1)]) < (length(stages) - 1))
     stop("Error - the column names of your discreteTrans matrix should be in alphabetical order, with continuous being the last one")
     for (j in stages[1:(length(stages) - 1)]) discreteTrans[,
     j] <- discreteTrans[, j]/sum(discreteTrans[, j], na.rm = TRUE)
     if (is.na(meanToCont[1]) & length(meanToCont) == 1) {
     meanToCont <- matrix(NA, nrow = 1, ncol = nDiscreteClasses,
     dimnames = list(1, stages[1:nDiscreteClasses]))
     for (j in stages[which(as.numeric(discreteTrans["continuous",
     1:nDiscreteClasses]) > 0)]) {
     meanToCont[, j] <- mean(dataf[dataf$stage == j &
     dataf$stageNext == "continuous", ]$sizeNext,
     na.rm = TRUE)
     }
     }
     if (class(meanToCont) != "matrix")
     stop("Error - the meanToCont matrix you entered should be a matrix")
     if (nrow(meanToCont) != 1)
     stop("Error - the meanToCont matrix you entered should contain just 1 row with means (or NA's for those discrete stages from which no individuals move to the continuous class")
     if (sum(dimnames(meanToCont)[[2]] == stages[1:nDiscreteClasses]) <
     nDiscreteClasses)
     stop("Error - the column names of the meanToCont matrix you entered should be in alphabetical order and match the column names of the discrete classes in discreteTrans (so without continuous). If some of the discete stages are not mentioned in your data file, this error can be fixed by adding those stages first: levels(dataf$stage)<-c(levels(dataf$stage),<unmentioned_discrete_stages>)")
     if (is.na(sdToCont[1]) & length(sdToCont) == 1) {
     sdToCont <- matrix(NA, nrow = 1, ncol = nDiscreteClasses,
     dimnames = list(1, stages[1:nDiscreteClasses]))
     for (j in stages[which(as.numeric(discreteTrans["continuous",
     1:nDiscreteClasses]) > 0)]) {
     sdToCont[, j] <- sd(dataf[dataf$stage == j & dataf$stageNext ==
     "continuous", ]$sizeNext, na.rm = TRUE)
     }
     }
     if (class(sdToCont) != "matrix")
     stop("Error - the sdToCont matrix you entered should be a matrix")
     if (nrow(sdToCont) != 1)
     stop("Error - the sdToCont matrix you entered should contain just 1 row with means (or NA's for those discrete stages from which no individuals move to the continuous class")
     if (sum(dimnames(sdToCont)[[2]] == stages[1:nDiscreteClasses]) <
     nDiscreteClasses)
     stop("Error - the column names of the sdToCont matrix you entered should be in alphabetical order and match the column names of the discrete classes in discreteTrans (so without continuous). If some of the discete stages are not mentioned in your data file, this error can be fixed by adding those stages first: levels(dataf$stage)<-c(levels(dataf$stage),<unmentioned_discrete_stages>)")
     if (sum(discreteTrans[stages[1:nDiscreteClasses], "continuous"]) ==
     0) {
     moveToDiscrete <- glm(rep(0, 21) ~ 1, family = binomial)
     }
     else {
     subData <- subset(dataf, dataf$stage == "continuous" &
     dataf$surv == 1)
     subData$contToDiscrete <- 1
     subData$contToDiscrete[subData$stageNext == "continuous"] <- 0
     subData$size2 <- subData$size^2
     subData$size3 <- subData$size^3
     if (length(grep("expsize", as.character(continuousToDiscreteExplanatoryVariables))) >
     0)
     subData$expsize <- exp(subData$size)
     if (length(grep("logsize", as.character(continuousToDiscreteExplanatoryVariables))) >
     0)
     subData$logsize <- log(subData$size)
     moveToDiscrete <- glm(paste("contToDiscrete~", continuousToDiscreteExplanatoryVariables,
     sep = ""), family = binomial, data = subData)
     }
     disTrans <- new("discreteTrans")
     disTrans@discreteTrans <- discreteTrans
     disTrans@meanToCont <- meanToCont
     disTrans@sdToCont <- sdToCont
     disTrans@moveToDiscrete <- moveToDiscrete
     return(disTrans)
    }
    <bytecode: 0x523ca30>
    <environment: namespace:IPMpack>
     --- function search by body ---
    Function makeDiscreteTrans in namespace IPMpack has this body.
     ----------- END OF FAILURE REPORT --------------
    
    Error: processing vignette 'IPMpack_Vignette.Rnw' failed with diagnostics:
     chunk 30
    Error in if (class(discreteTrans) != "matrix") stop("Error - the discreteTrans you entered should be a matrix") :
     the condition has length > 1
    
    --- failed re-building ‘IPMpack_Vignette.Rnw’
    
    SUMMARY: processing the following file failed:
     ‘IPMpack_Vignette.Rnw’
    
    Error: Vignette re-building failed.
    Execution halted
Flavor: r-devel-linux-x86_64-fedora-gcc

Version: 2.1
Check: for missing documentation entries
Result: WARN
    Undocumented S4 classes:
     'mMatrix'
    All user-level objects in a package (including S4 classes and methods)
    should have documentation entries.
    See chapter 'Writing R documentation files' in the 'Writing R
    Extensions' manual.
Flavors: r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8