# \donttest{
# Note that all examples here use argument
# failIfNoInternet = FALSE so that functions do
# not error out but simply return NULL if internet
# connection is not available, and thus
# fail gracefully rather than error out (required by CRAN).
# Remove this argument or set to TRUE so functions fail
# when internet resources (paleobiodb) is not available.
#graptolites
graptData <- getCladeTaxaPBDB("Graptolithina",
failIfNoInternet = FALSE)
dim(graptData)
sum(graptData$taxon_rank == "genus")
# so we can see that our call for graptolithina returned
# a large number of taxa, a large portion of which are
# individual genera
# (554 and 318 respectively, as of 03-18-19)
tetrapodList<-c("Archaeopteryx", "Columba", "Ectopistes",
"Corvus", "Velociraptor", "Baryonyx", "Bufo",
"Rhamphorhynchus", "Quetzalcoatlus", "Natator",
"Tyrannosaurus", "Triceratops", "Gavialis",
"Brachiosaurus", "Pteranodon", "Crocodylus",
"Alligator", "Giraffa", "Felis", "Ambystoma",
"Homo", "Dimetrodon", "Coleonyx", "Equus",
"Sphenodon", "Amblyrhynchus")
tetrapodData <-getSpecificTaxaPBDB(tetrapodList,
failIfNoInternet = FALSE)
dim(tetrapodData)
sum(tetrapodData$taxon_rank == "genus")
# should be 26, with all 26 as genera
#############################################
# Now let's try getting occurrence data
# getting occurrence data for a genus, sorting it
# Dicellograptus
dicelloData <- getPBDBocc("Dicellograptus",
failIfNoInternet = FALSE)
if(!is.null(dicelloData)){
dicelloOcc2 <- taxonSortPBDBocc(dicelloData,
rank = "species", onlyFormal = FALSE,
failIfNoInternet = FALSE)
names(dicelloOcc2)
}
# }
Run the code above in your browser using DataLab