site
s, dataset
s, or dataset IDs.Using the dataset ID, site object or dataset object, return all records associated with the data as a download_list
.
get_download(x, verbose = TRUE)
A single numeric dataset ID or a vector of numeric dataset IDs as returned by get_datasets
, or a site
, dataset
, or dataset_list
.
logical; should messages on API call be printed?
This command returns either object of class "try-error"
' (see try
) defined by the error returned from the Neotoma API call, or an object of class download_list
, containing a set of download
objects, each with relevant assemblage information and metadata:
The download
object is a list of lists and data frames that describe an assemblage, the constituent taxa, the chronology, site and PIs who contributed the data. The following are important components:
dataset
A table describing the collection, including dataset information, PI data compatible with get_contact
and site data compatable with get_site
.
sample.meta
Dataset information for the core, primarily the age-depth model and chronology. In cases where multiple age models exist for a single record the most recent chronology is provided here.
taxon.list
The list of taxa contained within the dataset, unordered, including information that can be used in get_taxa
counts
The assemblage data for the dataset, arranged with each successive depth in rows and the taxa as columns. All taxa are described in taxon.list
, the chronology is in sample.data
lab.data
A data frame of laboratory data, such as exotic pollen spike, amount of sample counted, charcoal counts, etc.
chronologies
A list of existing chronologies. If only a single chronology exists for a record then this is the same as the age-model in sample.meta
.
Neotoma Project Website: http://www.neotomadb.org API Reference: http://api.neotomadb.org/doc/resources/contacts
# NOT RUN {
# Search for sites with "Pseudotsuga" pollen that are older than 8kyr BP and
# that are roughly within western British Columbia:
t8kyr.datasets <- get_dataset(taxonname='*Picea*', loc=c(-90, 41, -89, 44),
ageold = 20000, ageyoung=10000)
# Returns 20 records (as of 04/04/2013), get the dataset for all records:
pollen.records <- get_download(t8kyr.datasets)
# Standardize the taxonomies for the different records using the WS64 taxonomy.
compiled.sites <- compile_taxa(pollen.records, list.name='WS64')
# Extract the Pseudotsuga curves for the sites:
get.curve <- function(x, taxa) {
if (taxa %in% colnames(x$counts)) {
count <- x$counts[,taxa]/rowSums(x$counts, na.rm=TRUE)
} else {
count <- rep(0, nrow(x$count))
}
data.frame(site = x$dataset$site.data$site.name,
age = x$sample.meta$age,
count = count)
}
curves <- do.call(rbind.data.frame,
lapply(compiled.sites, get.curve, taxa = 'Larix/Pseudotsuga'))
# For illustration, remove the sites with no Pseudotsuga occurance:
curves <- curves[curves$count > 0, ]
smooth.curve <- predict(loess(sqrt(count)~age, data=curves),
data.frame(age=seq(20000, 0, by = -100)))
plot(sqrt(count) ~ age, data = curves,
ylab = '% Pseudotsuga/Larix', xlab='Calibrated Years BP', pch=19,
col=rgb(0.1, 0.1, 0.1, 0.1), xlim=c(0, 20000))
lines(seq(20000, 0, by = -100), smooth.curve, lwd=2, lty=2, col=2)
# This figure shows us an apparent peak in Larix/Pseudotsuga pollen in the
# early-Holocene that lends support to a warmer, drier early-Holocene in
# western North America.
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab