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

> ### Name: LikShifts
> ### Title: LikShifts: Calculates the likelihood of time-dependent birth and
> ###   death rates given a phylogenetic tree.
> ### Aliases: LikShifts
> 
> ### ** Examples
> 
> 
> timevec<-c(0,0.15,0.25)
> lambdavec<-c(2.5,2,3)
> muvec<-c(0.5,0.7,0.6)
> x<-c(0.3,0.19,0.1)
> x1<-c(x,max(x)*1.1)
> x2<-c(x,max(x))
> sampling<-0.4
> grouptime<- rep(min(x)*0.95,length(x)+1)
> group<- cbind(grouptime,grouptime*0+1)
> group2 <- group
> group2[1,2] <- 4
> group2[2,2] <- 5
> group2[3,2] <- 3
> group3<-group
> group3[2,2]<-10
> 
> ### calculate likelihoods with root = 1
> 
> ## Shifts in speciation / extinction rates (Stadler, PNAS 2011; Smrckova & Stadler, Manuscript 2014)
> for (survival in c(0,1)) {
+ print(LikShiftsPP(x,timevec,lambdavec,muvec,sampling,survival=survival))
+ print(LikShifts(x,timevec,lambdavec,muvec,c(sampling,1,1),survival= survival))
+ print(LikShifts(x,timevec,lambdavec,muvec,c(sampling,1,1),survival= survival,groups=group))
+ print(LikShiftsSTT(par=c(lambdavec,muvec,timevec[-1]),x,x*0+1,sprob=c(0,0,0),
+ sampling=c(sampling,0,0),survival=survival,root=1))
+ print(" ")
+ }
[1] 2.322383
[1] 2.322383
grouptime 
 2.322383 
[1] 2.322383
[1] " "
[1] 0.9337149
[1] 0.9337149
grouptime 
0.9337149 
[1] 0.9337149
[1] " "
> 
> ## Shifts in speciation / extinction rates with group sampling
> for (survival in c(0,1)) {
+ print(LikShifts(x,timevec,lambdavec,muvec,c(sampling,1,1),survival= survival,groups=group2))
+ print(LikShifts(x,timevec,lambdavec,muvec,c(sampling,1,1),survival= survival,groups=group3))
+ print(" ")
+ }
grouptime 
 16.48329 
grouptime 
 16.48329 
[1] " "
grouptime 
 15.09463 
grouptime 
 15.09463 
[1] " "
> 
> ## Constant speciation and extinction rates 
> # condition on age of tree x[1] and number of tips n
> LikShiftsPP(x,timevec[1],lambdavec[1],muvec[1],sampling,n=1)
[1] -1.322236
> LikConstantn(lambdavec[1],muvec[1],sampling,x)
[1] -1.322236
> print(" ")
[1] " "
> # condition on age of tree x[1]
> for (survival in c(0,1)) {
+ print(LikConstant(lambdavec[1],muvec[1],sampling,x,root=1,survival=survival))
+ print(LikShiftsSTT(par=c(lambdavec[1],lambdavec[1],muvec[1],muvec[1],1),x,x*0+1,
+ sprob=c(0,0),sampling=c(sampling,1),survival=survival,root=1))
+ print(LikShiftsPP(x,c(0),lambdavec[1],muvec[1],sampling,root=1,survival=survival))
+ print(LikShifts(x,c(0),lambdavec[1],muvec[1],c(sampling),survival=survival))
+ print(LikShifts(x,c(0),lambdavec[1],muvec[1],c(sampling),survival= survival,groups=group))
+ print(LikShifts(x,c(0),c(lambdavec[1],lambdavec[1],lambdavec[1]),
+ c(muvec[1],muvec[1],muvec[1]),c(sampling,1,1),survival= survival))
+ print(" ")
+ }
[1] 2.055813
[1] 2.055813
[1] 2.055813
[1] 2.055813
grouptime 
 2.055813 
[1] 2.055813
[1] " "
[1] 0.7345498
[1] 0.7345498
[1] 0.7345498
[1] 0.7345498
grouptime 
0.7345498 
[1] 0.7345498
[1] " "
> 
> ## Diversity-dependent speciation rates
> # condition on age of tree x[1], survival = 0
> N<-10
> pars <- matrix(c(N,lambdavec[1],muvec[1],0,sampling),nrow=1)
> 
> ### calculate likelihoods with root = 0
> 
> ## Constant speciation and extinction rates 
> # condition on age of tree x[1] and number of tips n
> print(LikShiftsPP(x,timevec[1],lambdavec[1],muvec[1],sampling,root=0,n=1))
[1] -2.420848
> print(LikConstantn(lambdavec[1],muvec[1],sampling,x,root=0))
[1] -2.420848
> print(" ")
[1] " "
> # condition on age of tree x[1]
> for (survival in c(0,1)){
+ print(LikShiftsPP(x,c(0),lambdavec[1],muvec[1],sampling,root=0,survival=survival))
+ print(LikConstant(lambdavec[1],muvec[1],sampling,x,root=0,survival=survival))
+ print(" ")
+ }
[1] 1.050841
[1] 1.050841
[1] " "
[1] 0.390209
[1] 0.390209
[1] " "
> ## Diversity-dependent speciation rates
> # condition on age of tree x[1], survival = 0
> print(LikDD(c(lambdavec[1],muvec[1],N),x=sort(x),model=-1,root=0,sampling=sampling)[1])
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'print': error in evaluating the argument 'x' in selecting a method for function 'expm': 'length = 8' in coercion to 'logical(1)'
Calls: print ... lambda -> .handleSimpleError -> h -> .handleSimpleError -> h
Execution halted