# Search for sites with "Pseudotsuga" pollen that are older than 8kyr BP and
# find the relevant radiocarbon ages associated with the cores.
# Are some time periods better dated than others?
t8kyr.datasets <- get_dataset(taxonname='*Pseudotsuga*', loc=c(-150, 20, -100, 60),
ageyoung = 8000)
# Returns 116 records (as of 13/07/2015). These are the pollen records though, we want the sites:
geochron.records <- get_geochron(get_site(t8kyr.datasets))
# We want to extract all the radiocarbon ages from the records:
get_ages <- function(x){
any.ages <- try(x[[2]]$age[x[[2]]$age.type == 'Radiocarbon years BP'])
if(class(any.ages) == 'try-error') output <- NA
if(!class(any.ages) == 'try-error') output <- unlist(any.ages)
output
}
radio.chron <- unlist(sapply(geochron.records, get_ages))
hist(radio.chron[radio.chron<40000], breaks=seq(0, 40000, by = 500),
main = 'Distribution of radiocarbon dates for Pseudotsuga records',
xlab = 'Radiocarbon date (14C years before 1950)')Run the code above in your browser using DataLab