* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/TreePar.Rcheck’ * using R Under development (unstable) (2022-04-26 r82260) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘TreePar/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘TreePar’ version ‘3.3’ * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘TreePar’ can be installed ... [18s/44s] OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [30s/81s] NOTE LikAge: no visible global function definition for ‘read.table’ bd.ME.optim: no visible global function definition for ‘optim’ bd.ME.optim.rho: no visible global function definition for ‘optim’ bd.ME.optim.rho.all: no visible global function definition for ‘optim’ bd.MEyule.optim: no visible global function definition for ‘optimize’ bd.MEyule.optim: no visible global function definition for ‘optim’ bd.age.optim.matlab: no visible global function definition for ‘read.table’ bd.groups.conf: no visible global function definition for ‘uniroot’ bd.shifts.plot: no visible global function definition for ‘lines’ bdsky.stt.optim: no visible global function definition for ‘optim’ create.mat: no visible global function definition for ‘write.table’ Undefined global functions or variables: lines optim optimize read.table uniroot write.table Consider adding importFrom("graphics", "lines") importFrom("stats", "optim", "optimize", "uniroot") importFrom("utils", "read.table", "write.table") to your NAMESPACE file. * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking examples ... [7s/19s] ERROR 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]) ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- TreePar --- call from context --- lambda(m, SI) --- call from argument --- infs > 0 && infs <= N --- R stacktrace --- where 1: lambda(m, SI) where 2: makeMatrix() where 3: expm(makeMatrix() * dt) where 4: LikDD(c(lambdavec[1], muvec[1], N), x = sort(x), model = -1, root = 0, sampling = sampling) where 5: print(LikDD(c(lambdavec[1], muvec[1], N), x = sort(x), model = -1, root = 0, sampling = sampling)[1]) --- value of length: 8 type: logical --- [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE --- function from context --- function (infs, SI) { if (infs > 0 && infs <= N) { if (SI == TRUE) { return(beta * (1 - 1 * infs/N)) } else { return(beta) } } else return(0) } --- function search by body --- ----------- END OF FAILURE REPORT -------------- Fatal error: length > 1 in coercion to logical * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR, 1 NOTE See ‘/data/gannet/ripley/R/packages/tests-LENGTH1/TreePar.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 6:06.92, 128.41 + 12.28