#Simulate some fossil ranges with simFossilTaxa
set.seed(444)
taxa <- simFossilTaxa(p=0.1,q=0.1,nruns=1,mintaxa=60,maxtaxa=80,maxtime=1000,maxExtant=0)
#simulate a fossil record with imperfect sampling with sampleRanges()
rangesCont <- sampleRanges(taxa,r=0.1)
#Now let's use binTimeData to get ranges in discrete overlapping intervals
#via pre-set intervals input
presetIntervals <- cbind(c(1000,995,990,980,970,960,950,940,930,905),
c(995,989,960,975,960,950,930,930,900,885))
rangesDisc1 <- binTimeData(rangesCont,int.times=presetIntervals)
seqLists<-seqTimeList(rangesDisc1,nruns=10)
seqLists$nTaxa
seqLists$nIntervals
#apply freqRat as an example analysis
sapply(seqLists$timeLists,freqRat)
#notice the zero and infinite freqRat estimates? What's going on?
freqRat(seqLists$timeLists[[4]],plot=TRUE)
#too few taxa of two orthree interval durations for the ratio to work properly
#perhaps ignore these estimates
#with weighted selection of intervals
seqLists<-seqTimeList(rangesDisc1,nruns=10,weightSampling=TRUE)
seqLists$nTaxa
seqLists$nIntervals
sapply(seqLists$timeLists,freqRat)
#didn't have much effect in this simulated example
Run the code above in your browser using DataLab