Learn R Programming

neotoma (version 1.3.0)

get_geochron: Function to return geochronological data from records.

Description

Using the dataset ID, return all geochronological data associated with the dataID. At present, only returns the dataset in an unparsed format, not as a data table. This function will only download one dataset at a time.

Usage

get_geochron(x, verbose = TRUE)

Arguments

x
A numeric dataset ID or a vector of numeric dataset IDs, or an object of class of class site, dataset, dataset_list, download or download_list for which geochrons are required.
verbose
logical; should messages on API call be printed?

Value

  • This command returns either an object of class "try-error"' (see try) definined by the error returned from the Neotoma API call, or a geochronologic object, which is a list with two components, a dataset and a geochronology table, a data.frame with the following components:
  • sample.idA unique identifier for the geochronological unit.
  • age.typeString. The age type, one of calendar years, radiocarbon years, etc.
  • ageDated age of the material.
  • e.olderThe older error limit of the age value. Commonly 1 standard deviation.
  • e.youngThe younger error limit of the age value.
  • delta13CThe measured or assumed delta13C value for radiocarbon dates, if provided.
  • material.datedA table describing the collection, including dataset information, PI data compatable with get_contact and site data compatable with get_site.
  • geo.chron.typeText string, type of geochronological analysis, i.e., Radiocarbon dating, luminesence.
  • notesText string
  • infiniteBoolean, does the dated material return an "infinte" date?
  • A full data object containing all the relevant geochronological data available for a dataset.

References

Neotoma Project Website: http://www.neotomadb.org API Reference: http://api.neotomadb.org/doc/resources/contacts

Examples

Run this code
#  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 87 records (as of 01/08/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, 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