Title: | Access to the Neotoma Paleoecological Database Through R |
---|---|
Description: | NOTE: This package is deprecated. Please use the neotoma2 package described at https://github.com/NeotomaDB/neotoma2. Access paleoecological datasets from the Neotoma Paleoecological Database using the published API (<http://wnapi.neotomadb.org/>), only containing datasets uploaded prior to June 2020. The functions in this package access various pre-built API functions and attempt to return the results from Neotoma in a usable format for researchers and the public. |
Authors: | Simon J. Goring [aut, cre], Gavin L. Simpson [aut], Jeremiah P. Marsicek [ctb], Karthik Ram [aut], Luke Sosalla [ctb] |
Maintainer: | Simon J. Goring <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.7.7 |
Built: | 2024-12-15 05:01:57 UTC |
Source: | https://github.com/ropensci/neotoma |
Extracts age information from objects and returns them in a useful format.
ages(obj, ...) ## S3 method for class 'download' ages(obj, ...) ## S3 method for class 'download_list' ages(obj, ...)
ages(obj, ...) ## S3 method for class 'download' ages(obj, ...) ## S3 method for class 'download_list' ages(obj, ...)
obj |
an R object from which counts are to be extracted. |
... |
arguments passed to other methods. |
Methods are available for "download" and "download_list" objects.
Either a data frame of ages or a list of such objects.
Simon Goring
## Not run: ostracodes <- get_dataset(datasettype = 'ostracode') ostro.dl <- get_download(ostracodes) ostro.ages <- ages(ostro.dl) ## End(Not run)
## Not run: ostracodes <- get_dataset(datasettype = 'ostracode') ostro.dl <- get_download(ostracodes) ostro.ages <- ages(ostro.dl) ## End(Not run)
From multiple download*
s, dataset*
s or site
s, join them together into a single object.
bind(x, ...)
bind(x, ...)
x |
An object returned by one of the |
... |
other objects of the same class. |
To support further synthesis and analysis compile_download
works to transform a list
returned by get_download
into a large data frame with columns for site and sample attributes
and also with the associated assemblage data at each sample depth. This function also does the same for
single sites.
This command returns a larger list.
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org
## 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.poa <- get_dataset(taxonname="Thuja*", loc=c(-150, 20, -100, 60), ageyoung = 8000) t8kyr.canis <- get_dataset(taxonname="Canis*", loc=c(-150, 20, -100, 60), ageyoung = 8000) t8kyr.co_site <- bind(t8kyr.poa, t8kyr.canis) plot(t8kyr.co_site) #### # We want to look at four different dataset types across a forest-prairie # boundary: dataset_types <- c("ostracode surface sample", "water chemistry", "diatom surface sample", "pollen surface sample") # Run the `get_dataset` function for each of the different dataset types dataset_lists <- lapply(dataset_types, function(x) { get_dataset(datasettype=x, loc = c(-100,43,-92,48)) }) # Using do.call here to make sure that I don't have to split the list out. new_datasets <- do.call(bind, dataset_lists) # And voila! plot(new_datasets) ## End(Not run)
## 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.poa <- get_dataset(taxonname="Thuja*", loc=c(-150, 20, -100, 60), ageyoung = 8000) t8kyr.canis <- get_dataset(taxonname="Canis*", loc=c(-150, 20, -100, 60), ageyoung = 8000) t8kyr.co_site <- bind(t8kyr.poa, t8kyr.canis) plot(t8kyr.co_site) #### # We want to look at four different dataset types across a forest-prairie # boundary: dataset_types <- c("ostracode surface sample", "water chemistry", "diatom surface sample", "pollen surface sample") # Run the `get_dataset` function for each of the different dataset types dataset_lists <- lapply(dataset_types, function(x) { get_dataset(datasettype=x, loc = c(-100,43,-92,48)) }) # Using do.call here to make sure that I don't have to split the list out. new_datasets <- do.call(bind, dataset_lists) # And voila! plot(new_datasets) ## End(Not run)
Using a download
or dataset
object, open up a browser window in the users default browser. Passing a download_list
or dataset_list
will open Neotoma Explorer with the first object and return a warning.
Using a numeric value, download
, download_list
, dataset
or dataset_list
object, open up a browser window in the users default browser. Very large objects
browse(x)
browse(x)
x |
A numeric value, |
Returns a NULL value, opens a browser.
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org API Reference: http://wnapi.neotomadb.org/doc/resources/sites
## Not run: # Where are the XRF data? xrf.data <- get_dataset(datasettype='X-ray fluorescence (XRF)') browse(xrf.data) ## End(Not run)
## Not run: # Where are the XRF data? xrf.data <- get_dataset(datasettype='X-ray fluorescence (XRF)') browse(xrf.data) ## End(Not run)
Using a numeric value, download
, download_list
, dataset
or dataset_list
object, open up a browser window in the users default browser. Very large objects
## S3 method for class 'dataset' browse(x)
## S3 method for class 'dataset' browse(x)
x |
A |
Using a numeric value, download
, download_list
, dataset
or dataset_list
object, open up a browser window in the users default browser. Very large objects
## S3 method for class 'dataset_list' browse(x)
## S3 method for class 'dataset_list' browse(x)
x |
A |
Using a numeric value, download
, download_list
, dataset
or dataset_list
object, open up a browser window in the users default browser. Very large objects
## Default S3 method: browse(x)
## Default S3 method: browse(x)
x |
A numeric value with the dataset ID. |
Using a numeric value, download
, download_list
, dataset
or dataset_list
object, open up a browser window in the users default browser. Very large objects
## S3 method for class 'download' browse(x)
## S3 method for class 'download' browse(x)
x |
A |
Using a numeric value, download
, download_list
, dataset
or dataset_list
object, open up a browser window in the users default browser. Very large objects
## S3 method for class 'download_list' browse(x)
## S3 method for class 'download_list' browse(x)
x |
A |
Function to convert multiple downloads into a single large table.
From the assemblage data for multiple cores, return a single data.frame with columns for site metadata and assemblage data.
To support further synthesis and analysis compile_download
works to transform a list
returned by get_download
into a large data frame with columns for site and sample attributes
and also with the associated assemblage data at each sample depth. This function also does the same for
single sites.
compile_downloads(downloads)
compile_downloads(downloads)
downloads |
A download_list as returned by |
This command returns a data frame.
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org
Gavin DG, Oswald WW, Wahl ER, Williams JW. 2003. A statistical approach to evaluating distance metrics and analog assignments for pollen records. Quaternary Research 60: 356-367.
Whitmore J, Gajewski K, Sawada M, Williams JW, Shuman B, Bartlein PJ, Minckley T, Viau AE, Webb III T, Shafer S, Anderson P, Brubaker L. 2005. Modern pollen data from North America and Greenland for multi-scale paleoenvironmental applications. Quaternary Science Reviews 24: 1828-1848.
Williams J, Shuman B. 2008. Obtaining accurate and precise environmental reconstructions from the modern analog technique and North American surface pollen dataset. Quaternary Science Reviews. 27:669-687.
API Reference: http://wnapi.neotomadb.org/doc/resources/contacts
## 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_dataset(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. thuja.sites <- get_download(t8kyr.datasets) gold.p25 <- compile_taxa(thuja.sites, 'P25') all.gold <- compile_downloads(gold.p25) pollen.sums <- rowSums(all.gold[,11:ncol(all.gold)], na.rm=TRUE) plot(x = all.gold$age, y = all.gold$Cupressaceae.Taxaceae / pollen.sums, col = all.gold$site.name, pch = 19) ## End(Not run)
## 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_dataset(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. thuja.sites <- get_download(t8kyr.datasets) gold.p25 <- compile_taxa(thuja.sites, 'P25') all.gold <- compile_downloads(gold.p25) pollen.sums <- rowSums(all.gold[,11:ncol(all.gold)], na.rm=TRUE) plot(x = all.gold$age, y = all.gold$Cupressaceae.Taxaceae / pollen.sums, col = all.gold$site.name, pch = 19) ## End(Not run)
From the assemblage data for the core return assemblage data with the assemblage taxa Currently implemented only for pollen data.
compile_taxa(object, list.name, alt.table = NULL, cf = TRUE, type = TRUE)
compile_taxa(object, list.name, alt.table = NULL, cf = TRUE, type = TRUE)
object |
A pollen object returned by |
list.name |
The taxon compilation list, one of a set of lists from the literature (e.g., |
alt.table |
A user provided table formatted with at least two columns, one called 'taxon' and the other named as in |
cf |
Should taxa listed as *cf*s (*e.g.*, *cf*. *Gilia*) be considered highly resolved? |
type |
Should taxa listed as types (*e.g.*, *Iva annua*-type) be considered highly resolved? |
The data object uses the smaller pollen subset. As this package develops we will add the capacity to summarize data output from the translation. Currently we can return only subsets that have been defined in the literature. These lists include:
"P25"
This list is derived from Gavin et al., (2003), and includes 25 pollen taxa.
"WS64"
This list is derived from Williams and Shuman (2008).
"WhitmoreFull"
This is the full list associated with the Whitmore et al., (2005) North American Modern Pollen Database.
"WhitmoreSmall"
As above, but taxa for which both fully resolved and undifferentiated exist these taxa are summed.
This command returns a list object with the same structure as the parent pollen object returned by get_download
, or a matrix (or data frame) depending on whether object
is one or the other. Any pollen taxon not included in the major taxa defined in the pollen gets returned as 'Other'.
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org
Gavin DG, Oswald WW, Wahl ER, Williams JW. 2003. A statistical approach to evaluating distance metrics and analog assignments for pollen records. Quaternary Research 60: 356-367.
Whitmore J, Gajewski K, Sawada M, Williams JW, Shuman B, Bartlein PJ, Minckley T, Viau AE, Webb III T, Shafer S, Anderson P, Brubaker L. 2005. Modern pollen data from North America and Greenland for multi-scale paleoenvironmental applications. Quaternary Science Reviews 24: 1828-1848.
Williams J, Shuman B. 2008. Obtaining accurate and precise environmental reconstructions from the modern analog technique and North American surface pollen dataset. Quaternary Science Reviews. 27:669-687.
API Reference: http://wnapi.neotomadb.org/doc/resources/contacts
## 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_dataset(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]]) gold.p25 <- compile_taxa(GOLDKBG, 'P25') ## End(Not run)
## 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_dataset(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]]) gold.p25 <- compile_taxa(GOLDKBG, 'P25') ## End(Not run)
Extract pollen or other proxy counts from data objects and returns them in a useful format.
counts(obj, ...) ## S3 method for class 'download' counts(obj, ...) ## S3 method for class 'download_list' counts(obj, ...)
counts(obj, ...) ## S3 method for class 'download' counts(obj, ...) ## S3 method for class 'download_list' counts(obj, ...)
obj |
an R object from which counts are to be extracted. |
... |
arguments passed to other methods. |
Methods are available for "download" and "download_list" objects.
Either a data frame of counts or a list of such objects.
Gavin Simpson
## Not run: marion <- get_site('Marion Lake%') louise <- get_site('Louise Pond%') western.sites <- rbind(marion, louise) western.data <- get_dataset(western.sites) western.dl <- get_download(western.data) western.cnt <- counts(western.dl) sapply(western.cnt, dim) marion.cnt<- counts(western.dl[[1]]) dim(marion.cnt) ## End(Not run)
## Not run: marion <- get_site('Marion Lake%') louise <- get_site('Louise Pond%') western.sites <- rbind(marion, louise) western.data <- get_dataset(western.sites) western.dl <- get_download(western.data) western.cnt <- counts(western.dl) sapply(western.cnt, dim) marion.cnt<- counts(western.dl[[1]]) dim(marion.cnt) ## End(Not run)
Using a download
object, return the sample depths (if available).
Using a numeric value, download
, download_list
, dataset
or dataset_list
object, open up a browser window in the users default browser. Very large objects
depths(obj, ...) ## Default S3 method: depths(obj, ...) ## S3 method for class 'download' depths(obj, ...) ## S3 method for class 'download_list' depths(obj, ...)
depths(obj, ...) ## Default S3 method: depths(obj, ...) ## S3 method for class 'download' depths(obj, ...) ## S3 method for class 'download_list' depths(obj, ...)
obj |
A |
... |
arguments passed to other methods. |
Returns a vector of depths.
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org API Reference: http://wnapi.neotomadb.org/doc/resources/sites
## Not run: # Provide a vector of depths to generate a new age model: # The dataset id 684 is for Devils Lake, a record published by Louis Maher Jr. pollen.data <- get_download(684) pollen.chron <- get_chroncontrol(pollen.data)[[1]] age_sds <- pollen.chron$chron.control$age - focal$chron.control$age.young, get_curves <- ifelse(regexpr("Radiocarbon", pollen.chron$chron.control$control.type) > -1, 'intcal13', 'normal') new_chron <- Bchron::Bchronology(ages = pollen.chron$chron.control$age, ageSds = age_sds positions = pollen.chron$chron.control$depth, calCurves = , predictPositions = depths(pollen.data)) ## End(Not run)
## Not run: # Provide a vector of depths to generate a new age model: # The dataset id 684 is for Devils Lake, a record published by Louis Maher Jr. pollen.data <- get_download(684) pollen.chron <- get_chroncontrol(pollen.data)[[1]] age_sds <- pollen.chron$chron.control$age - focal$chron.control$age.young, get_curves <- ifelse(regexpr("Radiocarbon", pollen.chron$chron.control$control.type) > -1, 'intcal13', 'normal') new_chron <- Bchron::Bchronology(ages = pollen.chron$chron.control$age, ageSds = age_sds positions = pollen.chron$chron.control$depth, calCurves = , predictPositions = depths(pollen.data)) ## End(Not run)
A download
is an object with the full record for a single dataset.
A download
is an object with the full record for a single dataset.
TO DO
TO DO
Simon Goring
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.
get_chroncontrol(x, chronology = 1, verbose = TRUE, add = FALSE)
get_chroncontrol(x, chronology = 1, verbose = TRUE, add = FALSE)
x |
A single numeric chronology ID, a vector of numeric dataset IDs as returned by |
chronology |
When |
verbose |
logical, should messages on API call be printed? |
add |
logical, should this chron control be added to the download object? |
This command returns either an object of class "try-error"
containing the error returned
from the Neotoma API call, or a full data object containing all the relevant information required to build either the default or prior chronology for a core.
When download
or download_list
objects are passes, the user can add
the chroncontrol to the
download
object explicitly, in which case the function will return a download with chroncontrol
embedded.
This is a list comprising the following items:
chron.control |
A table describing the collection, including dataset information, PI data compatable with |
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. |
If Neotoma returns empty content, either the control table or the associated metadata (which happens in approximately 25
Simon J. Goring [email protected]
+ Neotoma Project Website: http://www.neotomadb.org + API Reference: http://wnapi.neotomadb.org/doc/resources/contacts
## Not run: # The point of pulling chronology tables is to re-build or examine the # chronological information that was used to build the age-depth model for # the core. You can do this by hand, but the `write_agefile` function works # with `download` objects directly. three_pines <- get_download(get_dataset(get_site("Three Pines Bog"), datasettype = "pollen")) pines_chron <- get_chroncontrol(three_pines) # Spline interpolation: model <- smooth.spline(x = pines_chron[[1]]$chron.control$depth, y = pines_chron[[1]]$chron.control$age) new_ages <- predict(model, x = three_pines[[1]]$sample.meta$depth) ## End(Not run)
## Not run: # The point of pulling chronology tables is to re-build or examine the # chronological information that was used to build the age-depth model for # the core. You can do this by hand, but the `write_agefile` function works # with `download` objects directly. three_pines <- get_download(get_dataset(get_site("Three Pines Bog"), datasettype = "pollen")) pines_chron <- get_chroncontrol(three_pines) # Spline interpolation: model <- smooth.spline(x = pines_chron[[1]]$chron.control$depth, y = pines_chron[[1]]$chron.control$age) new_ages <- predict(model, x = three_pines[[1]]$sample.meta$depth) ## End(Not run)
dataset
.Using a dataset
, return the default chron-control table.
## S3 method for class 'dataset' get_chroncontrol(x, chronology = 1, verbose = TRUE, add = FALSE)
## S3 method for class 'dataset' get_chroncontrol(x, chronology = 1, verbose = TRUE, add = FALSE)
x |
A |
chronology |
When |
verbose |
logical; should messages on API call be printed? |
add |
Should the |
dataset_list
.Using a dataset_list
, return the default chron-control table.
## S3 method for class 'dataset_list' get_chroncontrol(x, chronology = 1, verbose = TRUE, add = FALSE)
## S3 method for class 'dataset_list' get_chroncontrol(x, chronology = 1, verbose = TRUE, add = FALSE)
x |
A |
chronology |
When |
verbose |
logical; should messages on API call be printed? |
add |
Should the |
Using the chronology ID, return the chron control table as a data.frame
.
## Default S3 method: get_chroncontrol(x, chronology = 1, verbose = TRUE, add = FALSE)
## Default S3 method: get_chroncontrol(x, chronology = 1, verbose = TRUE, add = FALSE)
x |
A single numeric chronology ID or a vector of numeric chronology IDs as returned by |
chronology |
For |
verbose |
logical; should messages on API call be printed? |
add |
logical, should this chron control be added to the download object? |
download
object.Using a download
, return the default chron-control table as a data.frame
.
## S3 method for class 'download' get_chroncontrol(x, chronology = 1, verbose = TRUE, add = FALSE)
## S3 method for class 'download' get_chroncontrol(x, chronology = 1, verbose = TRUE, add = FALSE)
x |
A single |
chronology |
For |
verbose |
logical; should messages on API call be printed? |
add |
Should the |
download_list
object.Using a download_list
, return the default chron-control table as a data.frame
.
## S3 method for class 'download_list' get_chroncontrol(x, chronology = 1, verbose = TRUE, add = FALSE)
## S3 method for class 'download_list' get_chroncontrol(x, chronology = 1, verbose = TRUE, add = FALSE)
x |
A |
chronology |
When |
verbose |
logical; should messages on API call be printed? |
add |
Should the |
Passing in a download object the function outputs a Bacon or Clam formatted file to a user defined destination for age modelling with existing age-depth modeling software.
get_closest(x, n, buffer, ...)
get_closest(x, n, buffer, ...)
x |
A vector long/lat pair, or a dataset, site or download. |
n |
The maximum number of records to return (in the case of ties the return may be larger) |
buffer |
The size of the buffer for dataset search (in meters) |
... |
optional arguments to pass into |
The function uses the sf
package to generate a circular buffer around a point of interest.
From there a square bounding box is sent to Neotoma using the get_dataset()
function. To use the buffering
function we must convert from long/lat to UTM coordinates, which we do by guessing the UTM zone of the point of interest.
Details can be found in the function's R code hosted on GitHub: https://github.com/ropensci/neotoma/blob/master/R/get_closest.R
This command returns a dataset
or dataset_list
, or NULL if no records exist within the bounding box.
Simon J. Goring [email protected], Andria Dawson [email protected]
Neotoma Project Website: http://www.neotomadb.org API Reference: http://wnapi.neotomadb.org/doc/resources/contacts
## Not run: # The point of pulling chronology tables is to re-build or examine the chronological # information that was used to build the age-depth model for the core. # Find the closest records to Madison, WI: get_closest(x = c(-89.4012, 43.0731), n = 10, buffer = 5000, datasettype = "pollen") ## End(Not run)
## Not run: # The point of pulling chronology tables is to re-build or examine the chronological # information that was used to build the age-depth model for the core. # Find the closest records to Madison, WI: get_closest(x = c(-89.4012, 43.0731), n = 10, buffer = 5000, datasettype = "pollen") ## End(Not run)
A function to obtain contact information for data contributors from the Neotoma Paleoecological Database.
get_contact(contactid, contactname, contactstatus, familyname)
get_contact(contactid, contactname, contactstatus, familyname)
contactid |
Contact ID is a numerical value associated with the Neotoma Contact table's numerical Contact ID. |
contactname |
A character string indicating the data contributors' project, organization or personal name. May be a partial string and can include wildcards. |
contactstatus |
The current status of the contact. Possible values include: active, deceased, defunct, extant, inactive, retired, unknown. |
familyname |
A character string. Full or partial string indicating the contact's last name. |
The function takes parameters defined by the user and returns a list of contact information supplied by the Neotoma Paleoecological Database. The user may define all or none of the possible fields. The function contains data checks for each defined parameter.
The function returns either a single item of class "try-error"
describing
the reason for failure (either mis-defined parameters or an error from the Neotoma API),
or a table of contacts, with rows corresponding to the number of individual
contacts returned by the Neotoma API. Each row entry includes the following parameters:
contact.name |
Full name of the person, last name first (e.g. |
contact.status |
Current status of the person, organization, or project. Field links to the ContactStatuses lookup table. |
family.name |
Family or surname name of a person. |
leading.initials |
Leading initials for given or forenames without spaces (e.g. |
given.names |
Given or forenames of a person (e.g. |
suffix |
Suffix of a person's name (e.g. |
title |
A person's title (e.g. |
phone |
Telephone number. |
fax |
Fax number. |
email |
Email address. |
url |
Universal Resource Locator, an Internet World Wide Web address. |
address |
Full mailing address. |
notes |
Free form notes or comments about the person, organization, or project. |
contact.id |
Unique database record identifier for the contact. |
alias.id |
The ContactID of a person's current name. If the AliasID is different from the ContactID, the ContactID refers to the person's former name. |
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org API Reference: http://wnapi.neotomadb.org/doc/resources/contacts
## Not run: # To find all data contributors who are active: active.cont <- get_contact(contactstatus = 'active') # To find all data contributors who have the last name "Smith" smith.cont <- get_contact(familyname = 'Smith') ## End(Not run)
## Not run: # To find all data contributors who are active: active.cont <- get_contact(contactstatus = 'active') # To find all data contributors who have the last name "Smith" smith.cont <- get_contact(familyname = 'Smith') ## End(Not run)
A function to access the Neotoma API and return datasets corresponding to the parameters defined by the user.
get_dataset( x, datasettype, piid, altmin, altmax, loc, gpid, taxonids, taxonname, ageold, ageyoung, ageof, subdate )
get_dataset( x, datasettype, piid, altmin, altmax, loc, gpid, taxonids, taxonname, ageold, ageyoung, ageof, subdate )
x |
An optional value, either a |
datasettype |
A character string corresponding to one of the allowed dataset types in the Neotoma Database. Allowed types include: |
piid |
Numeric value for the Principle Investigator's ID number. |
altmin |
Numeric value indicating the minimum altitude for the site (can be used alone or with |
altmax |
Numeric value indicating the maximum altitude for the site (can be used alone or with |
loc |
A numeric vector |
gpid |
A character string or numeric value, must correspond to a valid geopolitical identity in the Neotoma Database. Use get.tables('GeoPoliticalUnits') for a list of acceptable values, or link here: http://wnapi.neotomadb.org/apdx/geopol.htm |
taxonids |
A numeric identifier for the taxon. See |
taxonname |
A character string corresponding to a valid taxon identity in the Neotoma Database. See |
ageold |
The oldest date acceptable for the search (in years before present). |
ageyoung |
The youngest date acceptable for the search. |
ageof |
If a taxon ID or taxon name is defined this parameter must be set to |
subdate |
Date of dataset submission, either YYYY-MM-DD or MM-DD-YYYY. |
With regards to datasettypes
, because Neotoma is a "living" database, and new dataset types are being added in an ongoing manner as new research disciplines use the database, you can use get_table("datasettypes")
to see the full list of available dataset types in the database.
More details on the use of these parameters can be obtained from http://wnapi.neotomadb.org/doc/resources/datasets.
A list of class 'dataset_list', with each item corresponding to an individual record. Searches that return no items will result in a NULL value being returned. Otherwise each list item (each dataset record) includes the following components:
dataset.id |
Unique database record identifier for the dataset. |
dataset.name |
Name of the dataset; not commonly used. |
CollUnitHandle |
Code name of the Collection Unit with which the dataset is associated. This code may be up to 10 characters. Data are frequently distributed by Collection Unit, and the Handle is used for file names. |
CollUnitID |
Unique database record identifier for the collection unit. |
CollType |
The collection type. Types include cores, sections, excavations, and animal middens. |
DatasetType |
The dataset type, such as: geochronologic, loss-on-ignition, pollen, plant macrofossils, vertebrate fauna, etc. |
AgeOldest |
The oldest of all sample ages (in calendar years before present) in the dataset. |
AgeYoungest |
The youngest of all sample ages (in calendar years before present) in the dataset. |
SubDates |
An array of objects that describe dataset submission events. If multiple submissions occurred then this is a table. |
DatasetPIs |
An array of objects that describe Principal Investigators associated with a dataset. |
Site |
An object describing the site where the dataset samples were taken. |
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org API Reference: http://wnapi.neotomadb.org/doc/resources/contacts
## 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_dataset(taxonname='Thuja*', loc=c(-150, 20, -100, 60), ageyoung = 8000) # Search for vertebrate fossils in Canada (gpid: 756) within the last 2kyr. gpids <- get_table(table.name='GeoPoliticalUnits') canID <- gpids[which(gpids$GeoPoliticalName == 'Canada'),1] v2kyr.datasets <- get_dataset(datasettype='vertebrate fauna', gpid=canID, ageold = 2000) ## End(Not run)
## 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_dataset(taxonname='Thuja*', loc=c(-150, 20, -100, 60), ageyoung = 8000) # Search for vertebrate fossils in Canada (gpid: 756) within the last 2kyr. gpids <- get_table(table.name='GeoPoliticalUnits') canID <- gpids[which(gpids$GeoPoliticalName == 'Canada'),1] v2kyr.datasets <- get_dataset(datasettype='vertebrate fauna', gpid=canID, ageold = 2000) ## End(Not run)
A function to access the Neotoma API and return datasets corresponding to the parameters defined by the user.
## Default S3 method: get_dataset( x, datasettype, piid, altmin, altmax, loc, gpid, taxonids, taxonname, ageold, ageyoung, ageof, subdate )
## Default S3 method: get_dataset( x, datasettype, piid, altmin, altmax, loc, gpid, taxonids, taxonname, ageold, ageyoung, ageof, subdate )
x |
A numeric value corresponding to the site ID. |
datasettype |
A character string corresponding to one of the allowed dataset types in the Neotoma Database. You can find the full list of allowed datasettypes using: |
piid |
Numeric value for the Principle Investigator's ID number. |
altmin |
Numeric value indicating the minimum altitude for the site (can be used alone or with |
altmax |
Numeric value indicating the maximum altitude for the site (can be used alone or with |
loc |
A numeric vector |
gpid |
A character string or numeric value, must correspond to a valid geopolitical identity in the Neotoma Database. Use get.tables('GeoPoliticalUnits') for a list of acceptable values, or link here: http://wnapi.neotomadb.org/apdx/geopol.htm |
taxonids |
A numeric identifier for the taxon. See |
taxonname |
A character string corresponding to a valid taxon identity in the Neotoma Database. See |
ageold |
The oldest date acceptable for the search (in years before present). |
ageyoung |
The youngest date acceptable for the search. |
ageof |
If a taxon ID or taxon name is defined this parameter must be set to |
subdate |
Date of dataset submission, either YYYY-MM-DD or MM-DD-YYYY. |
download
object.A function to access a dataset
within a download
object.
## S3 method for class 'download' get_dataset(x, ...)
## S3 method for class 'download' get_dataset(x, ...)
x |
An object of class |
... |
objects passed from the generic. Not used in the call. |
download_list
.A function to return datasets corresponding to the objects within a download_list
.
## S3 method for class 'download_list' get_dataset(x, ...)
## S3 method for class 'download_list' get_dataset(x, ...)
x |
An object of class |
... |
objects passed from the generic. Not used in the call. |
geochronologic
.A function to access the Neotoma API and return datasets corresponding to the parameters defined by the user.
## S3 method for class 'geochronologic' get_dataset(x, ...)
## S3 method for class 'geochronologic' get_dataset(x, ...)
x |
An object of class |
... |
objects passed from the generic. Not used in the call. |
geochronologic_list
.A function to access the Neotoma API and return datasets corresponding to the parameters defined by the user.
## S3 method for class 'geochronologic_list' get_dataset(x, ...)
## S3 method for class 'geochronologic_list' get_dataset(x, ...)
x |
An object of class |
... |
objects passed from the generic. Not used in the call. |
A function to access the Neotoma API and return datasets corresponding to the parameters defined by the user.
## S3 method for class 'integer' get_dataset(x = NULL, ...)
## S3 method for class 'integer' get_dataset(x = NULL, ...)
x |
A single numeric dataset id, or a numeric vector. |
... |
objects passed from the generic. Not used in the call. |
A function to access the Neotoma API and return datasets corresponding to the parameters defined by the user.
## S3 method for class 'numeric' get_dataset(x = NULL, ...)
## S3 method for class 'numeric' get_dataset(x = NULL, ...)
x |
A single numeric dataset id, or a numeric vector. |
... |
objects passed from the generic. Not used in the call. |
site
object.A function to access the Neotoma API and return datasets corresponding to the parameters defined by the user.
## S3 method for class 'site' get_dataset(x, ...)
## S3 method for class 'site' get_dataset(x, ...)
x |
An object of class |
... |
objects passed from the generic. Not used in the call. |
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)
get_download(x, verbose = TRUE)
x |
A single numeric dataset ID or a vector of numeric dataset IDs as returned by |
verbose |
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 |
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 |
counts |
The assemblage data for the dataset, arranged with each successive depth in rows and the taxa as columns. All taxa are described in |
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 |
The function returns a warning in cases where single taxa are defined by multiple taphonomic characteristics, for example grains that are identified separately as crumpled and torn in the same sample and sums these values within a sample.
In the case that a geochronology dataset is passed to get_download
the function returns a message and a NULL object (that is later excised). Use get_geochron
for these objects.
The chronologies can be augmented using the function get_chroncontrol
, where the individual chronology objects in chronologies
will consist of a table equivalent to sample.meta
and a chroncontrol
object.
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org API Reference: http://wnapi.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. ## End(Not run)
## 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. ## End(Not run)
dataset
.Using a dataset
, return all records associated with the data as a download_list
.
## S3 method for class 'dataset' get_download(x, verbose = TRUE)
## S3 method for class 'dataset' get_download(x, verbose = TRUE)
x |
An object of class |
verbose |
logical; should messages on API call be printed? |
dataset_list
.Using a dataset_list
, return all records associated with the data as a download_list
.
## S3 method for class 'dataset_list' get_download(x, verbose = TRUE)
## S3 method for class 'dataset_list' get_download(x, verbose = TRUE)
x |
An object of class |
verbose |
logical; should messages on API call be printed? |
numeric
dataset IDs.Using the dataset ID, return all records associated with the data as a download_list
.
## Default S3 method: get_download(x, verbose = TRUE)
## Default S3 method: get_download(x, verbose = TRUE)
x |
A single numeric dataset ID or a vector of numeric dataset IDs as returned by |
verbose |
logical; should messages on API call be printed? |
site
.Using a site
, return all records associated with the data as a download_list
.
## S3 method for class 'site' get_download(x, verbose = TRUE)
## S3 method for class 'site' get_download(x, verbose = TRUE)
x |
An object of class |
verbose |
logical; should messages on API call be printed? |
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.
get_geochron(x, verbose = TRUE)
get_geochron(x, verbose = TRUE)
x |
A numeric dataset ID or a vector of numeric dataset IDs, or an object of class of class |
verbose |
logical; should messages on API call be printed? |
This command returns either an object of class "try-error"
' (see try
) defined 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.id |
A unique identifier for the geochronological unit. |
age.type |
String. The age type, one of calendar years, radiocarbon years, etc. |
age |
Dated age of the material. |
e.older |
The older error limit of the age value. Commonly 1 standard deviation. |
e.young |
The younger error limit of the age value. |
delta13C |
The measured or assumed delta13C value for radiocarbon dates, if provided. |
material.dated |
A table describing the collection, including dataset information, PI data compatible with |
geo.chron.type |
Text string, type of geochronological analysis, i.e., Radiocarbon dating, luminesence. |
notes |
Text string |
infinite |
Boolean, does the dated material return an "infinite" date? |
A full data object containing all the relevant geochronological data available for a dataset.
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org API Reference: http://wnapi.neotomadb.org/doc/resources/contacts
## Not run: # Search for the sites around Marion Lake, BC. I want to find sites within # about 1km. marion <- get_site(sitename = "Marion Lake*") marion_close <- get_closest(marion, n = 10, buffer = 1) # Returns 116 records (as of 13/07/2015). These are the pollen records though, # we want the sites: geochron.records <- get_geochron(marion_close) # 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(is(any.ages, 'try-error')) output <- NA if(!is(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, 25000, by = 1000), main = 'Radiocarbon dates for Pseudotsuga records', xlab = 'Radiocarbon date (14C years before 1950)') ## End(Not run)
## Not run: # Search for the sites around Marion Lake, BC. I want to find sites within # about 1km. marion <- get_site(sitename = "Marion Lake*") marion_close <- get_closest(marion, n = 10, buffer = 1) # Returns 116 records (as of 13/07/2015). These are the pollen records though, # we want the sites: geochron.records <- get_geochron(marion_close) # 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(is(any.ages, 'try-error')) output <- NA if(!is(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, 25000, by = 1000), main = 'Radiocarbon dates for Pseudotsuga records', xlab = 'Radiocarbon date (14C years before 1950)') ## End(Not run)
The function takes the parameters, defined by the user, and returns a table with publication information from the Neotoma Paleoecological Database.
get_publication(x, contactid, datasetid, author, pubtype, year, search)
get_publication(x, contactid, datasetid, author, pubtype, year, search)
x |
Numeric Publication ID value, either from |
contactid |
Numeric Contact ID value, either from |
datasetid |
Numeric Dataset ID, known or from |
author |
Character string for full or partial author's name. Can include wildcards such as 'Smit*' for all names beginning with 'Smit'. |
pubtype |
Character string, one of eleven allowable types, see |
year |
Numeric publication year. |
search |
A character string to search for within the article citation. |
A list is returned with two data frame components:
meta |
A single row with Publication ID, type, year of publication and full citation. |
Authors |
|
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org API Reference: http://wnapi.neotomadb.org/doc/resources/contacts
## Not run: # To find all publications from 1998: year.cont <- get_publication(year = 1998) # To find all data contributors who have the last name "Smith" smith.cont <- get_publication(author = 'Smith') ## End(Not run)
## Not run: # To find all publications from 1998: year.cont <- get_publication(year = 1998) # To find all data contributors who have the last name "Smith" smith.cont <- get_publication(author = 'Smith') ## End(Not run)
The function takes a dataset
and returns a table with publication information from the Neotoma Paleoecological Database.
## S3 method for class 'dataset' get_publication(x, ...)
## S3 method for class 'dataset' get_publication(x, ...)
x |
an object of class |
... |
objects passed from the generic. Not used in the call. |
The function takes a dataset_list
and returns a table with publication information from the Neotoma Paleoecological Database.
## S3 method for class 'dataset_list' get_publication(x, ...)
## S3 method for class 'dataset_list' get_publication(x, ...)
x |
an object of class |
... |
objects passed from the generic. Not used in the call. |
The function takes the parameters, defined by the user, and returns a table with publication information from the Neotoma Paleoecological Database.
## Default S3 method: get_publication(x, contactid, datasetid, author, pubtype, year, search)
## Default S3 method: get_publication(x, contactid, datasetid, author, pubtype, year, search)
x |
Numeric Publication ID value, either from |
contactid |
Numeric Contact ID value, either from |
datasetid |
Numeric Dataset ID, known or from |
author |
Character string for full or partial author's name. Can include wildcards such as 'Smit*' for all names beginning with 'Smit'. |
pubtype |
Character string, one of eleven allowable types, see |
year |
Numeric publication year. |
search |
A character string to search for within the article citation. |
The function takes a download
and returns a table with publication information from the Neotoma Paleoecological Database.
## S3 method for class 'download' get_publication(x, ...)
## S3 method for class 'download' get_publication(x, ...)
x |
an object of class |
... |
objects passed from the generic. Not used in the call. |
The function takes a download_list
and returns a table with publication information from the Neotoma Paleoecological Database.
## S3 method for class 'download_list' get_publication(x, ...)
## S3 method for class 'download_list' get_publication(x, ...)
x |
an object of class |
... |
objects passed from the generic. Not used in the call. |
Return site information from the Neotoma Paleoecological Database.
get_site
returns site information from the Neotoma Paleoecological Database
based on parameters defined by the user.
get_site(sitename, altmin, altmax, loc, gpid, ...)
get_site(sitename, altmin, altmax, loc, gpid, ...)
sitename |
character string representing the full or partial site name, or an object of class |
altmin |
Minimum site altitude (in m). |
altmax |
Maximum site altitude (in m). |
loc |
A numeric vector c(lonW, latS, lonE, latN) representing the bounding box within which to search for sites. The convention here is to use negative values for longitudes west of Grewnwich or longitudes south of the equator. |
gpid |
A character string or numeric value, must correspond to a valid geopolitical identity in the Neotoma Database. Use get.tables('GeoPoliticalUnits') for a list of acceptable values, or link here: http://wnapi.neotomadb.org/apdx/geopol.htm |
... |
Optional additional arguments |
A data frame:
siteid |
Unique database record identifier for the site. |
sitename |
Name of the site. |
long |
Mean longitude, in decimal degrees, for a site (-180 to 180). |
lat |
Mean latitude, in decimal degrees, for a site (-90 to 90). |
elev |
Elevation in meters. |
description |
Free form description of a site, including such information as physiography and vegetation around the site. |
long_acc |
If the site is described by a bounding box this is the box width. |
lat_acc |
If the site is described by a bounding box this is the box height. |
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org API Reference: http://wnapi.neotomadb.org/doc/resources/sites
## Not run: # What is the distribution of site elevations in Neotoma? all.sites <- get_site() #takes a bit of time. plot(density(all.sites$elev, from = 0, na.rm=TRUE), main = 'Altitudinal Distribution of Neotoma Sites', xlab = 'Altitude (m)', log='x') # Get site information from a dataset: nw.datasets <- get_dataset(loc = c(-140, 50, -110, 65), datasettype='pollen', taxonname='Pinus*') nw.sites <- get_site(nw.datasets) ## End(Not run)
## Not run: # What is the distribution of site elevations in Neotoma? all.sites <- get_site() #takes a bit of time. plot(density(all.sites$elev, from = 0, na.rm=TRUE), main = 'Altitudinal Distribution of Neotoma Sites', xlab = 'Altitude (m)', log='x') # Get site information from a dataset: nw.datasets <- get_dataset(loc = c(-140, 50, -110, 65), datasettype='pollen', taxonname='Pinus*') nw.sites <- get_site(nw.datasets) ## End(Not run)
Return site information from the Neotoma Paleoecological Database.
## S3 method for class 'dataset' get_site(sitename, ...)
## S3 method for class 'dataset' get_site(sitename, ...)
sitename |
An object of class |
... |
Arguments passed from the generic method, not used. |
dataset_list
Return site information from the Neotoma Paleoecological Database.
## S3 method for class 'dataset_list' get_site(sitename, ...)
## S3 method for class 'dataset_list' get_site(sitename, ...)
sitename |
An object of class |
... |
Arguments passed from the generic method, not used. |
Return site information from the Neotoma Paleoecological Database.
## Default S3 method: get_site(sitename, ...)
## Default S3 method: get_site(sitename, ...)
sitename |
A character string representing the full or partial site name. |
... |
Arguments passed from the generic method, not used. |
download
Return site information from the Neotoma Paleoecological Database.
## S3 method for class 'download' get_site(sitename, ...)
## S3 method for class 'download' get_site(sitename, ...)
sitename |
An object of class |
... |
Arguments passed from the generic method, not used. |
download_list
Return site information from the Neotoma Paleoecological Database.
## S3 method for class 'download_list' get_site(sitename, ...)
## S3 method for class 'download_list' get_site(sitename, ...)
sitename |
An object of class |
... |
Arguments passed from the generic method, not used. |
geochronologic
Return site information from the Neotoma Paleoecological Database.
## S3 method for class 'geochronologic' get_site(sitename, ...)
## S3 method for class 'geochronologic' get_site(sitename, ...)
sitename |
An object of class |
... |
Arguments passed from the generic method, not used. |
geochronologic_list
Return site information from the Neotoma Paleoecological Database.
## S3 method for class 'geochronologic_list' get_site(sitename, ...)
## S3 method for class 'geochronologic_list' get_site(sitename, ...)
sitename |
An object of class |
... |
Arguments passed from the generic method, not used. |
Return site information from the Neotoma Paleoecological Database.
## S3 method for class 'integer' get_site(sitename, ...)
## S3 method for class 'integer' get_site(sitename, ...)
sitename |
An integer or vector of integers. |
... |
Arguments passed from the generic method, not used. |
Return site information from the Neotoma Paleoecological Database.
## S3 method for class 'numeric' get_site(sitename = NULL, ...)
## S3 method for class 'numeric' get_site(sitename = NULL, ...)
sitename |
A numeric value or vector of numeric elements. |
... |
Arguments passed from the generic method, not used. |
Get Neotoma value tables.
get_table(table.name = NULL)
get_table(table.name = NULL)
table.name |
Call one of the available tables in the Neotoma Database. A full listing of tables can be found here: http://wnapi.neotomadb.org/doc/resources/dbtables. By default it returns all objects in the table. |
A table of values corresponding to the parameter of interest.
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org API Reference: http://wnapi.neotomadb.org/doc/resources/contacts
## Not run: taxon.table <- get_table('Taxa') # Get the frequency of a random taxon in Neotoma. tax_sample <- sample(nrow(taxon.table), 1) cat("The taxon", taxon.table$TaxonName[tax_sample], "occurs in Neotoma", length(get_dataset(taxonname = taxon.table$TaxonName[tax_sample])), "times.") ## End(Not run)
## Not run: taxon.table <- get_table('Taxa') # Get the frequency of a random taxon in Neotoma. tax_sample <- sample(nrow(taxon.table), 1) cat("The taxon", taxon.table$TaxonName[tax_sample], "occurs in Neotoma", length(get_dataset(taxonname = taxon.table$TaxonName[tax_sample])), "times.") ## End(Not run)
Get taxon information from Neotoma.
get_taxa(taxonid, taxonname, status, taxagroup, ecolgroup)
get_taxa(taxonid, taxonname, status, taxagroup, ecolgroup)
taxonid |
Numeric taxon identifier used in Neotoma |
taxonname |
A character string representing the full or partial name of taxa of interest. |
status |
The current status of the taxon, one of 'extinct', 'extant', 'all'. |
taxagroup |
The taxonomic grouping for the taxa. See http://wnapi.neotomadb.org/doc/resources/taxa for the list of approved groupings. |
ecolgroup |
The ecological group of the taxa. More detailed than |
Returns a data frame with the following components:
TaxonID |
Unique database record identifier for a taxon |
TaxonCode |
Shorthand notation for a taxon identification |
TaxonName |
Name of the taxon |
Author |
Author(s) of the name. Used almost exclusively with beetle taxa |
Extinct |
True if extinct; false if extant |
TaxaGroup |
Code for taxa group to which taxon belongs |
EcolGroups |
Array of ecological group codes to which the taxon belongs |
HigherTaxonID |
TaxonID of the next higher taxonomic rank |
PublicationID |
Publication identification number |
Notes |
Free-form notes or comments about the taxon |
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org API Reference: http://wnapi.neotomadb.org/doc/resources/contacts
## Not run: ## Return all species taxa with "Abies" in name - note wildcard taxa <- get_taxa(taxonname = "Abies*") ## End(Not run)
## Not run: ## Return all species taxa with "Abies" in name - note wildcard taxa <- get_taxa(taxonname = "Abies*") ## End(Not run)
A list of geopolitical entities with associated numeric ID values.
gp.table
gp.table
a data.frame
object
Simon J. Goring [email protected]
The Neotoma database.
A plotting function to provide interactive data investigation using the leaflet tools. This package requires a connection to the internet for proper functioning.
plot_leaflet(x, providerTiles = "Stamen.TerrainBackground", ...)
plot_leaflet(x, providerTiles = "Stamen.TerrainBackground", ...)
x |
A neotoma data object |
providerTiles |
Default "Stamen.TerrainBackground", a character string indicating the tile background to be used for plotting. |
... |
Other terms to be passed to the function. |
A leaflet
object
A list of standardized (published) taxonomies from the literature to help standardize taxonomies for synthesis work.
data(pollen.equiv)
data(pollen.equiv)
a data.frame
object
Taxon conversion table (readable).
Simon J. Goring [email protected]; Jeremiah Marsicek
Reads in Bacon output and formats it for inclusion in a download object.
read_bacon( x, path = ".", add = FALSE, chron_name = "Bacon", as_default = TRUE, download = NULL, sections = NULL, age_field = "median", interp = TRUE )
read_bacon( x, path = ".", add = FALSE, chron_name = "Bacon", as_default = TRUE, download = NULL, sections = NULL, age_field = "median", interp = TRUE )
x |
A folder path that contains a Bacon |
path |
The location of the |
add |
Should the results be added to an existing |
chron_name |
The name for the chronology if the Bacon file is being added to a |
as_default |
Should the chronology become the default? |
download |
The target |
sections |
If there are multiple Bacon runs in a folder, identify the file by the number of sections in the run. |
age_field |
Should the age be assigned to the |
interp |
If the depths don't match up, should we interpolate from the Bacon output? (default |
The function expects that you are in a working directory containing a "Cores" which would then contain output files from Bacon runs. The output can either be added to an existing record (for example, replacing the default age model returned by Neotoma), or it can be loaded on its own. If the depths for the loaded file do not match with the depths in the ‘download'’s 'sample.meta' then the user can use the 'interp' parameter to interpolate between depths. This method uses linear interpolation.
## Not run: # Download the record for Lake O' Pines: lake_o_dl <- get_download(15925) # This assumes that you have Bacon installed in a folder and have # set it to your working directory. write_agefile(lake_o_dl[[1]], path = ".", chronology = 1, corename = "LAKEPINES", cal.prog = 'Bacon') source("Bacon.R") # These defaults just help the core run quickly, they're not # neccesarily good parameters. Bacon("LAKEPINES", acc.mean = 10, thick = 50, depths.file = TRUE, suggest = FALSE, ask = FALSE) lake_o_dl <- read_bacon("LAKEPINES", add = TRUE, download = download, sections = 17) ## End(Not run)
## Not run: # Download the record for Lake O' Pines: lake_o_dl <- get_download(15925) # This assumes that you have Bacon installed in a folder and have # set it to your working directory. write_agefile(lake_o_dl[[1]], path = ".", chronology = 1, corename = "LAKEPINES", cal.prog = 'Bacon') source("Bacon.R") # These defaults just help the core run quickly, they're not # neccesarily good parameters. Bacon("LAKEPINES", acc.mean = 10, thick = 50, depths.file = TRUE, suggest = FALSE, ask = FALSE) lake_o_dl <- read_bacon("LAKEPINES", add = TRUE, download = download, sections = 17) ## End(Not run)
Read proxy data from a Tilia TLX format file.
read.tilia(file)
read.tilia(file)
file |
a string representing a Tilia TLX format file. |
Return a 'download' object.
Simon J. Goring [email protected]
## Not run: crystal <- read.tilia('crystal.tlx') ## End(Not run)
## Not run: crystal <- read.tilia('crystal.tlx') ## End(Not run)
Draws paleoecological diagrams from a download
object. Allows control of variable type (using the tran
function from the analogue
package), and taxonomic grouping.
## S3 method for class 'download' Stratiplot(x, yaxis = "age", method = "none", group = NULL, ...)
## S3 method for class 'download' Stratiplot(x, yaxis = "age", method = "none", group = NULL, ...)
x |
A |
yaxis |
One of the columns in |
method |
An option for axis transformation using |
group |
An ecological group from the taxon table. |
... |
variables to be passed to |
A wrapper for the analogue
package's Stratiplot
function. Allowing the user to plot a stratigraphic diagram directly from a download
object.
A trellis
object.
## Not run: lake_o_dl <- get_download(15925) Stratiplot(lake_o_dl[[1]]) ## End(Not run)
## Not run: lake_o_dl <- get_download(15925) Stratiplot(lake_o_dl[[1]]) ## End(Not run)
Draws paleoecological diagrams from a download_list
object. Allows control of variable type (using the tran
function from the analogue
package), and taxonomic grouping.
This function only works for download_list
objects that contain a single object.
## S3 method for class 'download_list' Stratiplot(x, yaxis = "age", method = "none", group = NULL, ...)
## S3 method for class 'download_list' Stratiplot(x, yaxis = "age", method = "none", group = NULL, ...)
x |
A |
yaxis |
One of the columns in |
method |
An option for axis transformation using |
group |
An ecological group from the taxon table. |
... |
variables to be passed to |
A wrapper for the analogue
package's Stratiplot
function. Allowing the user to plot a stratigraphic diagram directly from a download
object.
A trellis
object.
## Not run: lake_o_dl <- get_download(15925) # This works: Stratiplot(lake_o_dl) lakes_o_nw <- get_download(get_site(sitename = "Lake B%")) # This Fails: # Stratiplot(lake_o_nw) ## End(Not run)
## Not run: lake_o_dl <- get_download(15925) # This works: Stratiplot(lake_o_dl) lakes_o_nw <- get_download(get_site(sitename = "Lake B%")) # This Fails: # Stratiplot(lake_o_nw) ## End(Not run)
Extracts taxa from download
objects and returns them in a useful format.
taxa(obj, ...) ## S3 method for class 'download' taxa(obj, ...) ## S3 method for class 'download_list' taxa(obj, collapse = TRUE, hierarchy = FALSE, ...)
taxa(obj, ...) ## S3 method for class 'download' taxa(obj, ...) ## S3 method for class 'download_list' taxa(obj, collapse = TRUE, hierarchy = FALSE, ...)
obj |
an R object from which counts are to be extracted. |
... |
arguments passed to other methods. |
collapse |
should the results be returned as a list, one for each site ( |
hierarchy |
Should the taxonomic hierarchy be included? |
Methods are available for "download" and "download_list" objects.
Either a data frame of taxa or a list of such objects.
Simon Goring
## Not run: ostracodes <- get_dataset(datasettype = 'ostracode') ostro.dl <- get_download(ostracodes) ostro.taxa <- taxa(ostro.dl) ## End(Not run)
## Not run: ostracodes <- get_dataset(datasettype = 'ostracode') ostro.dl <- get_download(ostracodes) ostro.taxa <- taxa(ostro.dl) ## End(Not run)
The taxonomy table for datasets in neotoma, as would be returned by get_table
data(taxon.list)
data(taxon.list)
a data.frame
object
Simon J. Goring [email protected]
The Neotoma database.
Passing in a download object the function outputs a Bacon or Clam formatted file to a user defined destination for age modelling with existing age-depth modeling software.
write_agefile(download, chronology = 1, path, corename, cal.prog = "Bacon")
write_agefile(download, chronology = 1, path, corename, cal.prog = "Bacon")
download |
A single site returned by |
chronology |
Default is |
path |
The location of the 'Cores' folder & working directory for Bacon. Do not include "Cores" in the path name. |
corename |
The intended handle for the core, to be used in writing to file. |
cal.prog |
The method intended to build the age model, either |
This command returns a file in location path/Cores
containing all the relevant information required to build either the default or prior chronology for a core.
Simon J. Goring [email protected]
Neotoma Project Website: http://www.neotomadb.org API Reference: http://wnapi.neotomadb.org/doc/resources/contacts
## Not run: # Find a particular record: three_pines <- get_download(get_dataset(get_site("Three Pines Bog"), datasettype = "pollen")) # You will need to edit the `path` argument here to point to a directory that # contains a `Cores` directory. write_agefile(download = three_pines[[1]], path = "./inst", corename = "THREEPINES", cal.prog = "Bacon") ## End(Not run)
## Not run: # Find a particular record: three_pines <- get_download(get_dataset(get_site("Three Pines Bog"), datasettype = "pollen")) # You will need to edit the `path` argument here to point to a directory that # contains a `Cores` directory. write_agefile(download = three_pines[[1]], path = "./inst", corename = "THREEPINES", cal.prog = "Bacon") ## End(Not run)