Running examples in ‘MicSim-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: micSim
> ### Title: Run microsimulation (sequentially)
> ### Aliases: micSim
> 
> ### ** Examples
> 
> ######################################################################################
> # 1. Simple example only dealing with mortality events
> ######################################################################################
> # Clean workspace 
> rm(list=ls())
> 
> # Defining simulation horizon
> simHorizon <- setSimHorizon(startDate="01/01/2000", endDate="31/12/2100")
> 
> # Seed for random number generator
> set.seed(234)
> 
> # Definition of maximal age
> maxAge <- 120
> 
> # Defintion of nonabsorbing and absorbing states
> sex <- c("m","f")
> stateSpace <- sex
> attr(stateSpace,"name") <- "sex"
> absStates <- "dead"
> 
> # Definition of an initial population 
> dts <- c("31/12/1930","03/04/1999","15/10/1956","11/11/1991","01/01/1965")
> birthDates <- chron(dates=dts,format=c(dates="d/m/Y"))
> initStates <- c("f","m","f","m","m")
> initPop <- data.frame(ID=1:5,birthDate=birthDates,initState=initStates)
> 
> # Definition of mortality rates (Gompertz model).
> mortRates <- function(age, calTime, duration){
+   a <- 0.00003
+   b <- ifelse(calTime<=2020, 0.1, 0.097)
+   rate <- a*exp(b*age)
+   return(rate)
+ }
> 
> # Transition pattern and assignment of functions specifying transition rates
> absTransitions <- c("dead","mortRates")
> transitionMatrix <- buildTransitionMatrix(allTransitions=NULL,
+   absTransitions=absTransitions, stateSpace=stateSpace)
> 
> # Execute microsimulation (sequentially, i.e., using only one CPU)
> pop <- micSim(initPop=initPop, transitionMatrix=transitionMatrix, absStates=absStates, 
+   maxAge=maxAge, simHorizon=simHorizon)
Initialization ... 
Warning in FUN(newX[, i], ...) : NAs introduced by coercion
Error in 0:(trunc(ran * 365.25) + 1) : NA/NaN argument
Calls: micSim -> apply -> FUN
Execution halted