get_download: Function to return full dataset records.

Description Usage Arguments Value Author(s) References Examples

Description

Using the dataset ID, return all records associated with the data. 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

1
  get_download(datasetid, verbose = TRUE)

Arguments

datasetid

A single numeric dataset ID or a vector of numeric dataset IDs as returned by get_datasets.

verbose

logical; should messages on API call be printed?

Value

This command returns either a 'try-error' definined by the error returned from the Neotoma API call, or a list comprising the following items:

A full data object containing all the relevant assemblage information and metadata neccessary to understand a site. The data 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.

Author(s)

Simon J. Goring simon.j.goring@gmail.com

References

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
#  Search for sites with "Thuja" pollen that are older than 8kyr BP and
#  that are on the west coast of North America:
t8kyr.datasets <- get_datasets(taxonname='Thuja*', loc=c(-150, 20, -100, 60), ageyoung = 8000)

#  Returns 3 records (as of 04/04/2013), get dataset for the first record, Gold Lake Bog.
GOLDKBG <- get_download(t8kyr.datasets[[1]]$DatasetID)

taxa.no <- nrow(GOLDKBG$taxon.list)

#  Of the 60 taxa in the record, plot the pollen curve for Abies over time:

##pollen <- GOLDKBG$taxon.list$VariableElement == 'pollen'
pol.curve <- data.frame(age = GOLDKBG$sample.meta$Age,
                        Abies = GOLDKBG$counts[,'Abies'] / rowSums(GOLDKBG$counts, na.rm = TRUE))
plot(Abies * 100 ~ age, data = pol.curve, type='b',
     ylab = '% Abies', xlab='Calibrated Years BP', pch=19)


## End(Not run)

neotoma documentation built on May 2, 2019, 5:55 p.m.