Methods for Editing or Converting Output from simFossilRecord
These are a set of functions available for manipulating, translating
and editing the objects of class
1 2 3 4 5 6 7
A list object output by
The date to slice the
Should the dating of events be shifted, so that the
date given for
The probability that a taxon is sampled at the modern time
A small number which sets a range around the
These functions exist to manipulate
simFossilRecord, particularly so that they can be interfaced
with functions in library
paleotree in the same way that output from the
deprecated 'legacy' simulation function
simFossilTaxa was used.
timeSliceFossilRecord takes a given
and 'slices' the data to remove any events that occur after the given
sliceTime and make it so any taxa still alive as of
are now listed as extant.
fossilRecord2fossilTaxa converts a
to the flat table format of taxon data as was originally output by deprecated function
simFossilTaxa, and can be taken as input by a number of
paleotree functions such as
fossilRecord2fossilRanges converts a
to the flat table format of observed taxon ranges, as is typically output by processing
simFossilRecord simulation output with
Depends on the function and the arguments given. See Details.
David W. Bapst.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
set.seed(44) record <- simFossilRecord(p=0.1, q=0.1, r=0.1, nruns=1, nTotalTaxa=c(20,30) ,nExtant=0, plot=TRUE) # time-slicing # let's try slicing this record at 940 time-units slicedRecord<-timeSliceFossilRecord(fossilRecord = record, sliceTime = 940) # and let's plot it divCurveFossilRecordSim(slicedRecord) # now with shiftRoot4TimeSlice = TRUE to shift the root age slicedRecord<-timeSliceFossilRecord(fossilRecord = record, sliceTime = 940, shiftRoot4TimeSlice = TRUE) # and let's plot it divCurveFossilRecordSim(slicedRecord) # plot look a little different due to how axis limits are treated... # notice that in both, 'modern' (extant) taxa are sampled with probability = 1 #let's try it again, make that probability = 0 # now with shiftRoot4TimeSlice=TRUE slicedRecord<-timeSliceFossilRecord(fossilRecord = record, sliceTime = 940, shiftRoot4TimeSlice = TRUE, modern.samp.prob = 0) # and let's plot it divCurveFossilRecordSim(slicedRecord) ############################ # converting to taxa objects and observed ranges # convert to taxa data taxa<-fossilRecord2fossilTaxa(record) # convert to ranges ranges<-fossilRecord2fossilRanges(record) # plot diversity curves with multiDiv multiDiv(list(taxa,ranges),plotMultCurves=TRUE) # should look a lot like what we got earlier # get the cladogram we'd obtain for these taxa with taxa2cladogram cladogram<-taxa2cladogram(taxa,plot=TRUE) # now get the time-scaled phylogenies with taxa2phylo # first, with tips extending to the true times of extinction treeExt<-taxa2phylo(taxa,plot=TRUE) # now, with tips extending to the first appearance dates (FADs) of taxa # get the FADs from the ranges FADs<-ranges[,1] treeFAD<-taxa2phylo(taxa,FADs,plot=TRUE)