#can simulate this type of data with sampleRanges
# just set ranges.only = FALSE
#let's try a simulation example:
set.seed(444)
taxa <- simFossilTaxa(p = 0.1,q = 0.1,nruns = 1,mintaxa = 20,
maxtaxa = 30, maxtime = 1000, maxExtant = 0)
sampledOccurrences <- sampleRanges(taxa,r = 0.5,ranges.only = FALSE)
# now try with horizonSampRate
horizonSampRate(sampOcc = sampledOccurrences)
# but we could also try with the *other* inputs
# useful because some datasets we may only have durations
# and number of sampling events for
filtered <- sampledOccurrences[!is.na(sampledOccurrences)]
dur <- sapply(filtered,max) - sapply(filtered,min)
nCol <- sapply(filtered,length)
# supply as durations and nCollections
horizonSampRate(durations = dur, nCollections=nCol)
Run the code above in your browser using DataLab