# NOT RUN {
#get some example occurrence and taxonomic data
data(graptPBDB)
#get the taxon tree: Linnean method
graptTreeLinnean <- makePBDBtaxonTree(
taxaDataPBDB = graptTaxaPBDB,
rankTaxon = "genus",
method = "Linnean")
#get the taxon tree: parentChild method
graptTreeParentChild <- makePBDBtaxonTree(
taxaDataPBDB = graptTaxaPBDB,
rankTaxon = "genus",
method = "parentChild")
# let's plot these and compare them!
plotTaxaTreePBDB(graptTreeParentChild)
plotTaxaTreePBDB(graptTreeLinnean)
####################################################
# let's try some other groups
#conodonts
conoData <- getCladeTaxaPBDB("Conodonta")
conoTree <- makePBDBtaxonTree(
taxaDataPBDB = conoData,
rankTaxon = "genus",
method = "parentChild")
# plot it!
plotTaxaTreePBDB(conoTree)
#asaphid trilobites
asaData <- getCladeTaxaPBDB("Asaphida")
asaTree <- makePBDBtaxonTree(
taxaDataPBDB = asaData,
rankTaxon = "genus",
method = "parentChild")
# plot it!
plotTaxaTreePBDB(asaTree)
#Ornithischia
ornithData <- getCladeTaxaPBDB("Ornithischia")
ornithTree <- makePBDBtaxonTree(
taxaDataPBDB = ornithData,
rankTaxon = "genus",
method = "parentChild")
plotTaxaTreePBDB(ornithTree)
#try Linnean!
#but first... need to drop repeated taxon first: Hylaeosaurus
findHylaeo <- ornithData$taxon_name == "Hylaeosaurus"
# there's actually only one accepted ID number
HylaeoIDnum <- unique(ornithData[findHylaeo,"taxon_no"])
HylaeoIDnum
# so, take which one has occurrences listed
dropThis <- which((ornithData$n_occs < 1) & findHylaeo)
ornithDataCleaned <- ornithData[-dropThis,]
ornithTree <- makePBDBtaxonTree(
ornithDataCleaned,
rankTaxon = "genus",
method = "Linnean")
plotTaxaTreePBDB(ornithTree)
########################
#Rhynchonellida
rynchData <- getCladeTaxaPBDB("Rhynchonellida")
rynchTree <- makePBDBtaxonTree(
taxaDataPBDB = rynchData,
rankTaxon = "genus",
method = "parentChild")
plotTaxaTreePBDB(rynchTree)
#some of these look pretty messy!
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab