| Title: | Working with the Neotoma Paleoecology Database |
|---|---|
| Description: | Access and manipulation of data using the Neotoma Paleoecology Database. <https://api.neotomadb.org/api-docs/>. Examples in functions that require API access are not executed during CRAN checks. Vignettes do not execute as to avoid API calls during CRAN checks. |
| Authors: | Dominguez Vidana Socorro [aut, cre] (ORCID: <https://orcid.org/0000-0002-7926-4935>), Simon Goring [aut] (ORCID: <https://orcid.org/0000-0002-2700-4605>) |
| Maintainer: | Dominguez Vidana Socorro <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.11 |
| Built: | 2026-04-13 08:21:58 UTC |
| Source: | https://github.com/neotomadb/neotoma2 |
sub
## S4 method for signature 'collunits,numeric' x[i] ## S4 method for signature 'datasets,numeric' x[i] ## S4 method for signature 'sites,numeric' x[i] ## S4 method for signature 'site,numeric' x[i] ## S4 method for signature 'site,character' x[i] ## S4 method for signature 'speleothems,numeric' x[i] ## S4 method for signature 'taxa,numeric' x[i]## S4 method for signature 'collunits,numeric' x[i] ## S4 method for signature 'datasets,numeric' x[i] ## S4 method for signature 'sites,numeric' x[i] ## S4 method for signature 'site,numeric' x[i] ## S4 method for signature 'site,character' x[i] ## S4 method for signature 'speleothems,numeric' x[i] ## S4 method for signature 'taxa,numeric' x[i]
x |
The |
i |
The numeric index |
sliced site object
Obtain one of the elements within a sites,
collectionunits, datasets, etc... Neotoma objects.
## S4 method for signature 'chronologies,numeric' x[[i]] ## S4 method for signature 'collunits,numeric' x[[i]] ## S4 method for signature 'contacts,numeric' x[[i]] ## S4 method for signature 'datasets,numeric' x[[i]] ## S4 method for signature 'publications,numeric' x[[i]] ## S4 method for signature 'samples,numeric' x[[i]] ## S4 method for signature 'sites,numeric' x[[i]] ## S4 method for signature 'speleothems,numeric' x[[i]] ## S4 method for signature 'taxa,numeric' x[[i]]## S4 method for signature 'chronologies,numeric' x[[i]] ## S4 method for signature 'collunits,numeric' x[[i]] ## S4 method for signature 'contacts,numeric' x[[i]] ## S4 method for signature 'datasets,numeric' x[[i]] ## S4 method for signature 'publications,numeric' x[[i]] ## S4 method for signature 'samples,numeric' x[[i]] ## S4 method for signature 'sites,numeric' x[[i]] ## S4 method for signature 'speleothems,numeric' x[[i]] ## S4 method for signature 'taxa,numeric' x[[i]]
x |
Neotoma2 nested object |
i |
iteration in nested list |
sliced site object
## Not run: some_site <- get_sites(sitename = "Site%", limit=3) some_site[[2]] ## End(Not run)## Not run: some_site <- get_sites(sitename = "Site%", limit=3) some_site[[2]] ## End(Not run)
Obtain one of the elements within a nested neotoma2 object
## S4 replacement method for signature 'collunits' x[[i]] <- value ## S4 replacement method for signature 'datasets' x[[i]] <- value ## S4 replacement method for signature 'publications' x[[i]] <- value ## S4 replacement method for signature 'samples' x[[i]] <- value ## S4 replacement method for signature 'sites' x[[i]] <- value ## S4 replacement method for signature 'speleothems' x[[i]] <- value ## S4 replacement method for signature 'taxa' x[[i]] <- value## S4 replacement method for signature 'collunits' x[[i]] <- value ## S4 replacement method for signature 'datasets' x[[i]] <- value ## S4 replacement method for signature 'publications' x[[i]] <- value ## S4 replacement method for signature 'samples' x[[i]] <- value ## S4 replacement method for signature 'sites' x[[i]] <- value ## S4 replacement method for signature 'speleothems' x[[i]] <- value ## S4 replacement method for signature 'taxa' x[[i]] <- value
x |
|
i |
iteration in |
value |
The value to be used |
sites object with reassigned values
subset
## S4 replacement method for signature 'collunit,character' x[i] <- value ## S4 replacement method for signature 'collunit,numeric' x[i] <- value ## S4 replacement method for signature 'dataset,character' x[i] <- value ## S4 replacement method for signature 'dataset,numeric' x[i] <- value ## S4 replacement method for signature 'sample,character' x[i] <- value ## S4 replacement method for signature 'site,character' x[i] <- value ## S4 replacement method for signature 'site,numeric' x[i] <- value ## S4 replacement method for signature 'speleothem,character' x[i] <- value ## S4 replacement method for signature 'speleothem,numeric' x[i] <- value ## S4 replacement method for signature 'taxon,character' x[i] <- value ## S4 replacement method for signature 'taxon,numeric' x[i] <- value## S4 replacement method for signature 'collunit,character' x[i] <- value ## S4 replacement method for signature 'collunit,numeric' x[i] <- value ## S4 replacement method for signature 'dataset,character' x[i] <- value ## S4 replacement method for signature 'dataset,numeric' x[i] <- value ## S4 replacement method for signature 'sample,character' x[i] <- value ## S4 replacement method for signature 'site,character' x[i] <- value ## S4 replacement method for signature 'site,numeric' x[i] <- value ## S4 replacement method for signature 'speleothem,character' x[i] <- value ## S4 replacement method for signature 'speleothem,numeric' x[i] <- value ## S4 replacement method for signature 'taxon,character' x[i] <- value ## S4 replacement method for signature 'taxon,numeric' x[i] <- value
x |
A |
i |
The column indicator. |
value |
The value to be used. |
site object with reassigned character values
Obtain slots of a neotoma2 without using at-mark
## S4 method for signature 'chronology' x$name ## S4 method for signature 'chronologies' x$name ## S4 method for signature 'collunit' x$name ## S4 method for signature 'collunits' x$name ## S4 method for signature 'contact' x$name ## S4 method for signature 'contacts' x$name ## S4 method for signature 'dataset' x$name ## S4 method for signature 'datasets' x$name ## S4 method for signature 'publication' x$name ## S4 method for signature 'samples' x$name ## S4 method for signature 'sample' x$name ## S4 method for signature 'site' x$name ## S4 method for signature 'sites' x$name ## S4 method for signature 'speleothem' x$name ## S4 method for signature 'speleothems' x$name ## S4 method for signature 'taxon' x$name ## S4 method for signature 'taxa' x$name## S4 method for signature 'chronology' x$name ## S4 method for signature 'chronologies' x$name ## S4 method for signature 'collunit' x$name ## S4 method for signature 'collunits' x$name ## S4 method for signature 'contact' x$name ## S4 method for signature 'contacts' x$name ## S4 method for signature 'dataset' x$name ## S4 method for signature 'datasets' x$name ## S4 method for signature 'publication' x$name ## S4 method for signature 'samples' x$name ## S4 method for signature 'sample' x$name ## S4 method for signature 'site' x$name ## S4 method for signature 'sites' x$name ## S4 method for signature 'speleothem' x$name ## S4 method for signature 'speleothems' x$name ## S4 method for signature 'taxon' x$name ## S4 method for signature 'taxa' x$name
x |
|
name |
name of the slot |
value at chosen slot in the site object
cash-set
## S4 replacement method for signature 'chronology' x$name <- value ## S4 replacement method for signature 'collunit' x$name <- value ## S4 replacement method for signature 'dataset' x$name <- value ## S4 replacement method for signature 'site' x$name <- value ## S4 replacement method for signature 'speleothem' x$name <- value ## S4 replacement method for signature 'taxon' x$name <- value## S4 replacement method for signature 'chronology' x$name <- value ## S4 replacement method for signature 'collunit' x$name <- value ## S4 replacement method for signature 'dataset' x$name <- value ## S4 replacement method for signature 'site' x$name <- value ## S4 replacement method for signature 'speleothem' x$name <- value ## S4 replacement method for signature 'taxon' x$name <- value
x |
A |
name |
name of the slot |
value |
The value to be used. |
neotoma2 object with reassigned values
Given a collunit, add a new chronology object to the unit
with both the chronology metadata and the age information (as y)
add_chronology(object, x, y) ## S4 method for signature 'collunit,chronology,data.frame' add_chronology(object, x, y)add_chronology(object, x, y) ## S4 method for signature 'collunit,chronology,data.frame' add_chronology(object, x, y)
object |
A collection unit object |
x |
A chronology object generated using |
y |
A data.frame of sample ages, with required columns:
|
When undertaking analysis we may wish to add a new chronology to existing records within Neotoma. To do this we must first build the chronology, but also link it to existing analysis units within the collection unit. For examples from this function, see the https://open.neotomadb.org/EPD_binder/complex_workflow.html documentation online.
chronologies with new added chronology
Socorro Dominguez [email protected]
Returns neotoma2 object's data as a data.frame.
## S4 method for signature 'chronology' as.data.frame(x) ## S4 method for signature 'chronologies' as.data.frame(x) ## S4 method for signature 'collunit' as.data.frame(x) ## S4 method for signature 'collunits' as.data.frame(x) ## S4 method for signature 'contact' as.data.frame(x) ## S4 method for signature 'contacts' as.data.frame(x) ## S4 method for signature 'dataset' as.data.frame(x) ## S4 method for signature 'datasets' as.data.frame(x) ## S4 method for signature 'authors' as.data.frame(x) ## S4 method for signature 'publication' as.data.frame(x) ## S4 method for signature 'publications' as.data.frame(x) ## S4 method for signature 'site' as.data.frame(x) ## S4 method for signature 'sites' as.data.frame(x) ## S4 method for signature 'speleothem' as.data.frame(x) ## S4 method for signature 'speleothems' as.data.frame(x) ## S4 method for signature 'taxon' as.data.frame(x) ## S4 method for signature 'taxa' as.data.frame(x)## S4 method for signature 'chronology' as.data.frame(x) ## S4 method for signature 'chronologies' as.data.frame(x) ## S4 method for signature 'collunit' as.data.frame(x) ## S4 method for signature 'collunits' as.data.frame(x) ## S4 method for signature 'contact' as.data.frame(x) ## S4 method for signature 'contacts' as.data.frame(x) ## S4 method for signature 'dataset' as.data.frame(x) ## S4 method for signature 'datasets' as.data.frame(x) ## S4 method for signature 'authors' as.data.frame(x) ## S4 method for signature 'publication' as.data.frame(x) ## S4 method for signature 'publications' as.data.frame(x) ## S4 method for signature 'site' as.data.frame(x) ## S4 method for signature 'sites' as.data.frame(x) ## S4 method for signature 'speleothem' as.data.frame(x) ## S4 method for signature 'speleothems' as.data.frame(x) ## S4 method for signature 'taxon' as.data.frame(x) ## S4 method for signature 'taxa' as.data.frame(x)
x |
|
data.frame object
This class combines the S4 class contact with a numeric
author order. This allows us to reuse contact objects, and to assign
the authorship order within a publication. The full set of authors for
a publication are represented by the authors object.
object of class author
{ simon <- new("contact", familyname = "Goring", givennames = "Simon J.") firstauthor <- new("author", author = simon, order = 1) }{ simon <- new("contact", familyname = "Goring", givennames = "Simon J.") firstauthor <- new("author", author = simon, order = 1) }
neotoma2 objectsc - Combine neotoma2 objects
## S4 method for signature 'chronologies' c(x, y) ## S4 method for signature 'collunits' c(x, y) ## S4 method for signature 'contacts' c(x, y) ## S4 method for signature 'contact' c(x, y) ## S4 method for signature 'datasets' c(x, y) ## S4 method for signature 'publications' c(x, y) ## S4 method for signature 'samples' c(x, y) ## S4 method for signature 'sites' c(x, y) ## S4 method for signature 'missingOrNULL' c(x = "missingORNULL", y) ## S4 method for signature 'speleothems' c(x, y) ## S4 method for signature 'taxa' c(x, y)## S4 method for signature 'chronologies' c(x, y) ## S4 method for signature 'collunits' c(x, y) ## S4 method for signature 'contacts' c(x, y) ## S4 method for signature 'contact' c(x, y) ## S4 method for signature 'datasets' c(x, y) ## S4 method for signature 'publications' c(x, y) ## S4 method for signature 'samples' c(x, y) ## S4 method for signature 'sites' c(x, y) ## S4 method for signature 'missingOrNULL' c(x = "missingORNULL", y) ## S4 method for signature 'speleothems' c(x, y) ## S4 method for signature 'taxa' c(x, y)
x |
|
y |
|
concatenated and cleaned sites object
Uses the Neotoma API to search and access information about individuals who have contributed to the data in the Neotoma Paleoecology Database
check_contacts(x, ...) ## S3 method for class 'contacts' check_contacts(x, similarity = 0.5, ...)check_contacts(x, ...) ## S3 method for class 'contacts' check_contacts(x, similarity = 0.5, ...)
x |
contacts A |
... |
Additional parameters associated with the call. |
similarity |
The similarity score between matched records (from 0 - 1). |
contacts object
Simon Goring [email protected]
Show the samples table
chroncontrols(x)chroncontrols(x)
x |
Sites object to extract chroncontrols table from |
data.frame with chroncontrols information
For a site that includes collection units with chronologies return the chronological controls that are used in building the chronology.
## S4 method for signature 'site' chroncontrols(x)## S4 method for signature 'site' chroncontrols(x)
x |
site object |
data.frame with chronological controls
For all sites that includes collection units with chronologies return the chronological controls that are used in building the chronology.
## S4 method for signature 'sites' chroncontrols(x)## S4 method for signature 'sites' chroncontrols(x)
x |
sites object |
data.frame with chronological controls
Socorro Dominguez [email protected]
Obtain the chronology from a record or multiple records.
chronologies(x) ## S4 method for signature 'collunits' chronologies(x) ## S4 method for signature 'site' chronologies(x) ## S4 method for signature 'sites' chronologies(x)chronologies(x) ## S4 method for signature 'collunits' chronologies(x) ## S4 method for signature 'site' chronologies(x) ## S4 method for signature 'sites' chronologies(x)
x |
sites object that contains chronologies |
chronologies object with all chronologies used.
chronologies informationThe class for chronologies from the
Neotoma Paleoecology Database. A single collection unit may
have one or more chronology. The individual chronology
classes are grouped into an S4 chronologies class.
object of class chronologies
chronologies from a sites or collunits object.Extract chronologies from a sites or collunits object.
## S4 method for signature 'collunit' chronologies(x)## S4 method for signature 'collunit' chronologies(x)
x |
A |
chronologies from a collunit object
The function, applied to a data object with a valid dataset, will return a properly formatted data citation for the record.
cite_data(x) ## S4 method for signature 'site' cite_data(x) ## S4 method for signature 'NULL' cite_data(x)cite_data(x) ## S4 method for signature 'site' cite_data(x) ## S4 method for signature 'NULL' cite_data(x)
x |
Object with DOIs associated to it. |
data.frame with citation data
Given complete dataset objects in Neotoma (must have used
get_datasets() or get_downloads()), return a formatted
citation for the record, including the dataset DOI.
## S4 method for signature 'sites' cite_data(x)## S4 method for signature 'sites' cite_data(x)
x |
sites object |
data.frame object with citation information.
## Not run: # Get datasets metadata from API ds <- get_datasets(1) ## End(Not run)## Not run: # Get datasets metadata from API ds <- get_datasets(1) ## End(Not run)
Function that removes duplicate objects such as sites, datasets, or collection units. When we pull in a large number of objects, or overlapping searches, we can run into a problem where we have multiple instances of the same site, but with different datasets. This function attempts to gather all objects together:
Before: {site: 1, dataset: 1}, {site: 1, dataset: 2}
After: {site: 1, dataset: [1, 2]} So the site is gathered, and the datasets are now part of an array of datasets.
clean(x, verbose = TRUE, ...) ## S3 method for class 'sites' clean(x, verbose = TRUE, ...) ## S3 method for class 'collunits' clean(x, verbose = TRUE, ...) ## S3 method for class 'datasets' clean(x, verbose = TRUE, ...)clean(x, verbose = TRUE, ...) ## S3 method for class 'sites' clean(x, verbose = TRUE, ...) ## S3 method for class 'collunits' clean(x, verbose = TRUE, ...) ## S3 method for class 'datasets' clean(x, verbose = TRUE, ...)
x |
sites, datasets, collunits that may have duplicates. |
verbose |
parameter to prints out progress bar |
... |
Additional parameters associated with the call. |
clean neotoma objects without duplicates after concatenation
Simon Goring [email protected]
## Not run: tryCatch({ alex <- get_sites(sitename = "Alex%") alex2 <- get_sites(24) c <- c(alex, alex2) #uncleaned }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)## Not run: tryCatch({ alex <- get_sites(sitename = "Alex%") alex2 <- get_sites(24) c <- c(alex, alex2) #uncleaned }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)
Extract collection units from a sites object
collunits(object) ## S4 method for signature 'site' collunits(object)collunits(object) ## S4 method for signature 'site' collunits(object)
object |
A sites object |
collunits detail from a sites object
collection units information.A collection unit represents a collection event from within
a site. For example, a lake sediment core, or a single dig site within an
archaeological site.
object of class collunits
collunits from a sites object.Extract collunits from a sites object.
## S4 method for signature 'sites' collunits(object)## S4 method for signature 'sites' collunits(object)
object |
A |
collunits from a sites object
An unordered list of individual S4 contact objects.
object of class contact
{ new("contact", familyname = "Goring", givennames = "Simon J.") }{ new("contact", familyname = "Goring", givennames = "Simon J.") }
Obtain coordinates from a sites object.
coordinates(obj, ...)coordinates(obj, ...)
obj |
A sites object |
... |
Additional parameters associated with the call. |
dataframe with coordinate values
Return the latitude and longitude of sites
## S4 method for signature 'sites' coordinates(obj, ...)## S4 method for signature 'sites' coordinates(obj, ...)
obj |
A sites object |
... |
Additional parameters associated with the call. |
data.frame object with site coordinates.
datasets informationThe standard object class for datasets
from the Neotoma Paleoecology Database.
object of class datasets
If the sites object contains datasets, then the datasets
will be returned. If the sites object does not contain datasets then
the user can apply get_datasets() to the object.
datasets(object) ## S4 method for signature 'collunit' datasets(object) ## S4 method for signature 'sites' datasets(object) ## S4 method for signature 'site' datasets(object)datasets(object) ## S4 method for signature 'collunit' datasets(object) ## S4 method for signature 'sites' datasets(object) ## S4 method for signature 'site' datasets(object)
object |
A sites object |
datasets object specific to the metadata contained in datasets
datasets from a sites or collunits object.Extract datasets from a sites or collunits object.
## S4 method for signature 'collunits' datasets(object)## S4 method for signature 'collunits' datasets(object)
object |
A |
datasets object
Obtain the DOI for publications or datasets.
doi(x) ## S4 method for signature 'publication' doi(x) ## S4 method for signature 'site' doi(x)doi(x) ## S4 method for signature 'publication' doi(x) ## S4 method for signature 'site' doi(x)
x |
Object with DOIs associated to it. |
doi object with DOI information
Given complete dataset objects in Neotoma (must have used
get_datasets() or get_downloads()), return the dataset
DOI for the record.
## S4 method for signature 'sites' doi(x)## S4 method for signature 'sites' doi(x)
x |
a Neotoma2 |
data.frame object with DOIs information.
## Not run: # Get datasets metadata from API and retrieve DOIs ds <- get_datasets(1) doi(ds) ## End(Not run)## Not run: # Get datasets metadata from API and retrieve DOIs ds <- get_datasets(1) doi(ds) ## End(Not run)
filter for Neotoma sites objects.The filter function takes a sites object
and allows a user to filter on a number of properties. Since a sites object
is a nested object (it contains collection units, datasets, samples, etc.)
the degree to which filtering occurs depends on the amount of data contained
within the sites object. Filtering parameters include:
siteid A numeric site identifier from the Neotoma Database.
sitename The character string sitename.
lat A numeric latitude value.
long A numeric longitude value.
altitude The elevation of the site. Note that some sites do not
include elevation information. For these an NA value appears, and they
would be removed when using an elevation filter.
datasetid A numeric datasetid from Neotoma.
database A character string naming the constituent database
from which the dataset is drawn.
datasettype A character string representing one of the many
dataset types within Neotoma.
age_range_old A dataset-level parameter indicating the oldest
date covered by the dataset chronology.
age_range_young A dataset-level parameter indicating the youngest
date covered by the dataset chronology.
notes Free-form dataset notes provided by the dataset PI(s),
analysts or data stewards.
collectionunitid A numeric collection unit identifier from
Neotoma.
handle A character string identifying the collection unit. These
are often shorter form names (originally a default 8 character length).
collectionunitname A character string identifying the collection
unit name.
colldate The date on which the collection unit was sampled. Many
of these are empty.
location A free-form character string indicating the location of
the collection unit within the site.
waterdepth A numeric depth at which the core was obtained.
collunittype A character string for the collection unit type.
collectiondevice A fixed vocabulary term for the collection
device.
depositionalenvironment A fixed vocabulary name for the
depositional environment.
filter(.data, ..., .by = NULL, .preserve = FALSE) ## S3 method for class ''NULL'' filter(.data, ...) ## S3 method for class 'sites' filter(.data, ...) ## S3 method for class 'data.frame' filter(.data, ..., .by = NULL, .preserve = FALSE)filter(.data, ..., .by = NULL, .preserve = FALSE) ## S3 method for class ''NULL'' filter(.data, ...) ## S3 method for class 'sites' filter(.data, ...) ## S3 method for class 'data.frame' filter(.data, ..., .by = NULL, .preserve = FALSE)
.data |
A site, dataset, download, or data frame |
... |
Additional arguments passed to |
.by |
(only used for filtering |
.preserve |
(only used for filtering |
filtered sites object
Simon Goring [email protected]
Socorro Dominguez [email protected]
## Not run: # Download 10 sites, but only keep the sites that are close to sea level. tryCatch({ some_sites <- get_sites(sitename = "Lake%", limit = 3) site_subset <- some_sites %>% filter(altitude < 100) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) # Download 10 sites, get all associated datasets, but keep only # sites/datasets that are of datasettype "pollen": tryCatch({ sites <- get_sites(limit = 10) %>% get_datasets() pollen_subset <- sites %>% filter(datasettype == "pollen") }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)## Not run: # Download 10 sites, but only keep the sites that are close to sea level. tryCatch({ some_sites <- get_sites(sitename = "Lake%", limit = 3) site_subset <- some_sites %>% filter(altitude < 100) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) # Download 10 sites, get all associated datasets, but keep only # sites/datasets that are of datasettype "pollen": tryCatch({ sites <- get_sites(limit = 10) %>% get_datasets() pollen_subset <- sites %>% filter(datasettype == "pollen") }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)
contact information for Neotoma contributorsUses the Neotoma API to search and access information about individuals who have contributed to the data in the Neotoma Paleoecology Database
get_contacts(x = NA, ...) ## S3 method for class 'numeric' get_contacts(x, ...) ## Default S3 method: get_contacts(x, ...)get_contacts(x = NA, ...) ## S3 method for class 'numeric' get_contacts(x, ...) ## Default S3 method: get_contacts(x, ...)
x |
integer A contact ID |
... |
( |
contacts object
Simon Goring [email protected]
Socorro Dominguez [email protected]
The get_datasets() function is a wrapper for the Neotoma datasets API
endpoint.
The function takes parameters defined by the user and returns dataset
information supplied by the Neotoma Paleoecological Database.
The user may define all or none of the possible fields.
get_datasets(x = NA, ...) ## S3 method for class 'numeric' get_datasets(x, ...) ## Default S3 method: get_datasets(x, ...) ## S3 method for class 'sites' get_datasets(x, ...) ## S3 method for class 'site' get_datasets(x, ...) ## S3 method for class ''NULL'' get_datasets(x, ...)get_datasets(x = NA, ...) ## S3 method for class 'numeric' get_datasets(x, ...) ## Default S3 method: get_datasets(x, ...) ## S3 method for class 'sites' get_datasets(x, ...) ## S3 method for class 'site' get_datasets(x, ...) ## S3 method for class ''NULL'' get_datasets(x, ...)
x |
A single datasetid, or a vector of unique dataset ids. |
... |
accepted arguments, see details for more information. |
A dataset is an element nested within neotoma2 site objects. The
get_datasets() call returns a list of individual site objects with
collunits (collection units) that contain valid, matching dataset
elements.
So, get_sites() returns only site metadata. get_datasets() returns
site metadata, plus metadata about the individual datasets present at that
site.
The get_datasets() function searches for each site within Neotoma
that matches the query parameters, and returns them as a sites object,
a list of site objects, plus returns all the additional metadata for
the datasets at that site.
The get_datasets() command wraps the Neotoma API
(api.neotomadb.org) call for datasets.
The call itself uses a SQL query which accepts any one of the following
parameters:
siteid The unique site ID (integer) in Neotoma. Can be passed as a
vector of site IDs.
sitename The site name, or approximate match using the % wildcard.
database The constituent database for the record. See
get_table("constituentdatabases")
datasettype Neotoma contains data for a number of dataset types.
This returns a subset of data types. For a complete list of available
dataset types, run neotoma2::get_table('datasettypes')
altmin The minimum altitude range for site elevation (in meters).
altmax The maximum altitude range for site elevation (in meters).
datasetid The unique dataset ID (integer) in Neotoma. Can be passed
as a vector of dataset IDs.
doi The dataset DOI for a dataset contained within a site. Can be
passed as a vector of DOIs.
gpid The geopolitical name or identifier containing a site. Can be
passed as a vector of names.
keywords Keywords for samples within a set of sites. For example
"modern" indicates a sample within the record uses the keyword "modern".
contacts Contact names or IDs associated with a site.
ageyoung A minimum spanning age for the record, in years before
radiocarbon present (1950).
ageold A maximum spanning age for the record, in years before
radiocarbon present (1950).
ageof An age which must be contained within the range of sample ages
for a site.
taxa The names of taxa which must be present within samples in a
record.
all_data The API only downloads the first 25 records of the query.
For the complete records, use all_data=TRUE
The function returns either a single item of class "try-error"
describing the reason for failure (either misdefined parameters or an error
from the Neotoma API), or list of site objects, each containing one or more
collunit objects, with fully populated datasets elements.
Socorro Dominguez [email protected]
## Not run: tryCatch({ random_sites <- get_sites(1) allds <- get_datasets(random_sites, limit=3) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) # To find all datasets with a min altitude of 12 and a max altitude of 25: tryCatch({ sites_12to25 <- get_datasets(altmin=12, altmax=25) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) # To find all datasets in Brazil brazil <- '{"type": "Polygon", "coordinates": [[ [-73.125, -9.102096738726443], [-56.953125,-33.137551192346145], [-36.5625,-7.710991655433217], [-68.203125,13.923403897723347], [-73.125,-9.102096738726443]]]}' tryCatch({ brazil_datasets <- get_datasets(loc = brazil[1], limit=2) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)## Not run: tryCatch({ random_sites <- get_sites(1) allds <- get_datasets(random_sites, limit=3) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) # To find all datasets with a min altitude of 12 and a max altitude of 25: tryCatch({ sites_12to25 <- get_datasets(altmin=12, altmax=25) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) # To find all datasets in Brazil brazil <- '{"type": "Polygon", "coordinates": [[ [-73.125, -9.102096738726443], [-56.953125,-33.137551192346145], [-36.5625,-7.710991655433217], [-68.203125,13.923403897723347], [-73.125,-9.102096738726443]]]}' tryCatch({ brazil_datasets <- get_datasets(loc = brazil[1], limit=2) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)
Open up the Neotoma R homepage.
get_documentation()get_documentation()
Socorro Dominguez [email protected]
## Not run: if (interactive()) { get_documentation() } ## End(Not run)## Not run: if (interactive()) { get_documentation() } ## End(Not run)
Download sites objects up to datum and chronology detail level.
get_downloads(x = NA, ...) ## S3 method for class 'numeric' get_downloads(x, ...) ## S3 method for class 'sites' get_downloads(x, verbose = TRUE, ...) ## S3 method for class ''NULL'' get_downloads(x, ...)get_downloads(x = NA, ...) ## S3 method for class 'numeric' get_downloads(x, ...) ## S3 method for class 'sites' get_downloads(x, verbose = TRUE, ...) ## S3 method for class ''NULL'' get_downloads(x, ...)
x |
Use a single number to extract site information |
... |
accepted arguments: sites, datasets |
verbose |
Status bar of items being downloaded |
The get_downloads() command wraps the Neotoma API
(api.neotomadb.org) call for downloads.
The call itself uses a SQL query which accepts any one of the following
parameters:
datasetid The unique dataset ID (integer) in Neotoma. Can be passed
as a vector of dataset IDs.
all_data The API only downloads the first 25 records of the query.
For the complete records, use all_data=TRUE
The function returns either a single item of class
"try-error" describing the reason for failure
(either misdefined parameters or an error from the Neotoma API),
or a table of sites, with rows corresponding to the number of
individual sites and datasets returned by the Neotoma API.
Each "site" object contains 6 parameters that can be accessed as well:
siteid |
site ID number |
sitename |
site's name |
location |
sf object that describes site's location |
description |
|
collunits |
limited information on collunits |
Each "collection unit" embedded in the "sites" object contains 6 parameters that can be accessed as well:
collunitid |
collection unit ID number |
handle |
collection unit's handle |
collunitname |
collection unit's name |
colldate |
date in collection unit |
substrate |
substrate |
location |
sf object that describes site's location |
datasets |
detailed information regarding dataset |
Each "dataset" nested in the "collection unit" contains the following detail of information:
datasetid |
dataset ID number |
datasetname |
site's name |
datasettype |
type of data found |
location |
sf object that describes site's location |
notes |
notes on the dataset |
taxa table |
taxa table |
pi list |
P.I. info |
analyst |
analyst info |
metadata |
dataset metadata |
Socorro Dominguez [email protected]
## Not run: # To find the downloads object of dataset 24: tryCatch({ downloads24 <- get_downloads(24) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) # To find all downloads in Brazil brazil <- '{"type": "Polygon", "coordinates": [[ [-73.125, -9.102096738726443], [-56.953125,-33.137551192346145], [-36.5625,-7.710991655433217], [-68.203125,13.923403897723347], [-73.125,-9.102096738726443]]]}' tryCatch({ brazil_datasets <- get_datasets(loc = brazil[1]) brazil_downloads <- get_downloads(brazil_datasets) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)## Not run: # To find the downloads object of dataset 24: tryCatch({ downloads24 <- get_downloads(24) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) # To find all downloads in Brazil brazil <- '{"type": "Polygon", "coordinates": [[ [-73.125, -9.102096738726443], [-56.953125,-33.137551192346145], [-36.5625,-7.710991655433217], [-68.203125,13.923403897723347], [-73.125,-9.102096738726443]]]}' tryCatch({ brazil_datasets <- get_datasets(loc = brazil[1]) brazil_downloads <- get_downloads(brazil_datasets) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)
Open up the Neotoma manual homepage.
get_manual()get_manual()
NULL side effect for opening browser with the manual
Simon Goring [email protected]
## Not run: # This call does not work from `source()` calls or in testing. # interactive() just lets us know you are interacting with the console: if (interactive()) { get_manual() } ## End(Not run)## Not run: # This call does not work from `source()` calls or in testing. # interactive() just lets us know you are interacting with the console: if (interactive()) { get_manual() } ## End(Not run)
Uses the Neotoma API to search and access information about publications associated with data in the Neotoma Paleoecology Database
get_publications(x = NA, ...) ## Default S3 method: get_publications(...) ## S3 method for class 'numeric' get_publications(x, ...) ## S3 method for class 'publication' get_publications(x, ...) ## S3 method for class 'publications' get_publications(x, ...) ## S3 method for class 'sites' get_publications(x, ...)get_publications(x = NA, ...) ## Default S3 method: get_publications(...) ## S3 method for class 'numeric' get_publications(x, ...) ## S3 method for class 'publication' get_publications(x, ...) ## S3 method for class 'publications' get_publications(x, ...) ## S3 method for class 'sites' get_publications(x, ...)
x |
integer A contact ID |
... |
|
publications object
## Not run: # How old are the papers in Neotoma that include the term "mammut"? tryCatch({ mammoth_papers <- get_publications(search="mammut") %>% as.data.frame() hist(as.numeric(mammoth_papers$year)) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) # We want the paper identified in Neotoma as 666: tryCatch({ get_publications(666) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) # Take a publication object and purposely degrade the metadata: tryCatch({ bad_pub <- get_publications(666) # Note this only changes the reported year, not the citation string. bad_pub[[1]]@year <- "1923" bad_pub[[1]]@publicationid <- NA_integer_ updated_pubs <- get_publications(bad_pub[[1]]) attr(updated_pubs, "matches") # we see the proper citation in the record: updated_pubs <- attr(updated_pubs, "matches")[[3]] }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)## Not run: # How old are the papers in Neotoma that include the term "mammut"? tryCatch({ mammoth_papers <- get_publications(search="mammut") %>% as.data.frame() hist(as.numeric(mammoth_papers$year)) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) # We want the paper identified in Neotoma as 666: tryCatch({ get_publications(666) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) # Take a publication object and purposely degrade the metadata: tryCatch({ bad_pub <- get_publications(666) # Note this only changes the reported year, not the citation string. bad_pub[[1]]@year <- "1923" bad_pub[[1]]@publicationid <- NA_integer_ updated_pubs <- get_publications(bad_pub[[1]]) attr(updated_pubs, "matches") # we see the proper citation in the record: updated_pubs <- attr(updated_pubs, "matches")[[3]] }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)
The get_sites function is a wrapper for the Neotoma sites API
endpoint.
The function takes parameters defined by the user and returns a list
of site information supplied by the Neotoma Paleoecological Database.
The user may define all or none of the possible fields.
get_sites(x = NA, ...) ## S3 method for class 'numeric' get_sites(x, ...) ## Default S3 method: get_sites(...) ## S3 method for class ''NULL'' get_sites(x, ...)get_sites(x = NA, ...) ## S3 method for class 'numeric' get_sites(x, ...) ## Default S3 method: get_sites(...) ## S3 method for class ''NULL'' get_sites(x, ...)
x |
Use a single integer or vector of integers representing unique Neotoma site identifiers (siteids) to extract site information. |
... |
accepted arguments, see details for more information. |
A site object in Neotoma is a physical location at which one or more
collection units are located. Each collection unit may have one or more
datasets within it, defined by the dataset type. The get_sites()
function searches for each site within Neotoma that matches the query
parameters, and returns them as a sites object, a list of site
objects. The get_sites() command wraps the Neotoma API
(api.neotomadb.org) call for sites.
The call itself uses a SQL query which accepts any one of the following
parameters:
siteid The unique site ID (integer) in Neotoma. Can be passed as a
vector of site IDs.
sitename The site name, or approximate match using the % wildcard.
database The constituent database for the record.
See get_table("constituentdatabases")
altmin The minimum altitude range for site elevation (in meters).
altmax The maximum altitude range for site elevation (in meters).
datasetid The unique dataset ID (integer) in Neotoma. Can be passed
as a vector of dataset IDs.
datasettype Neotoma contains data for a number of datasettypes.
This returns a subset of data types. For a complete list of available
datasettypes, run neotoma2::get_table('datasettypes')
doi The dataset DOI for a dataset contained within a site. Can be
passed as a vector of DOIs.
gpid The geopolitical name or identifier containing a site. Can be
passed as a vector of names.
keywords Keywords for samples within a set of sites. For example
"modern" indicates a sample within the record uses the keyword "modern".
contacts Contact names or IDs associated with a site.
ageyoung A minimum spanning age for the record, in years before
radiocarbon present (1950).
ageold A maximum spanning age for the record, in years before
radiocarbon present (1950).
ageof An age which must be contained within the range of sample ages
for a site.
taxa The names of taxa which must be present within samples in a
record.
all_data The API only downloads the first 25 records of the query.
For the complete records, use all_data=TRUE
This call will then return a data object that contains site metadata for one
or more sites, along with limited metadata describing the collection units
and datasets located at that site.
The function returns either a single item of class "try-error"
describing the reason for failure (either misdefined parameters or an error
from the Neotoma API), or a table of sites, with rows corresponding to the
number of individual sites returned by the Neotoma API.
Each "site" object contains 6 parameters that can be accessed as well:
siteid, sitename, location, altitude, description,
limited collection units information.
loc An sf object that describes site's location.
description
collunits limited information on collunits
Socorro Dominguez [email protected]
## Not run: ## Find sites with a min altitude of 12m and a max altitude of 25m sites_12to25 <- get_sites(altmin=12, altmax=25) sites_2500 <- get_sites(altmin=2500, all_data = TRUE) ## To find sites in Brazil brazil <- '{"type": "Polygon", "coordinates": [[ [-73.125, -9.102096738726443], [-56.953125,-33.137551192346145], [-36.5625,-7.710991655433217], [-68.203125,13.923403897723347], [-73.125,-9.102096738726443]]]}' brazil_sites <- get_sites(loc = brazil[1]) ## End(Not run)## Not run: ## Find sites with a min altitude of 12m and a max altitude of 25m sites_12to25 <- get_sites(altmin=12, altmax=25) sites_2500 <- get_sites(altmin=2500, all_data = TRUE) ## To find sites in Brazil brazil <- '{"type": "Polygon", "coordinates": [[ [-73.125, -9.102096738726443], [-56.953125,-33.137551192346145], [-36.5625,-7.710991655433217], [-68.203125,13.923403897723347], [-73.125,-9.102096738726443]]]}' brazil_sites <- get_sites(loc = brazil[1]) ## End(Not run)
get_speleothems
get_speleothems(x = NA, ...) ## S3 method for class 'numeric' get_speleothems(x, ...) ## S3 method for class 'sites' get_speleothems(x, ...)get_speleothems(x = NA, ...) ## S3 method for class 'numeric' get_speleothems(x, ...) ## S3 method for class 'sites' get_speleothems(x, ...)
x |
A dataset ID or vector of dataset IDs |
... |
accepted arguments |
Experimental function: API and behavior may change.
The get_speleothems() command wraps the Neotoma API
(api.neotomadb.org) call for speleothems.
The call itself uses a SQL query which accepts any one of the following
parameters:
x The unique dataset ID (integer) in Neotoma. Can be passed as a
vector of dataset IDs.
sites A sites R object.
sites object with speleothem data
Socorro Dominguez [email protected]
## Not run: ## Find speleothems by numeric datasetid: speleo <- get_speleothems(c(2,5)) ## End(Not run)## Not run: ## Find speleothems by numeric datasetid: speleo <- get_speleothems(c(2,5)) ## End(Not run)
Returns a count of sites, datasets, publications and other objects added to Neotoma during the requested time period.
get_stats(start = 0, end = 1, type = "dsdbmonth")get_stats(start = 0, end = 1, type = "dsdbmonth")
start |
The starting month (from present == 0) for which to generate the summary. Default is 0 (the current month). |
end |
The ending month (from present == 0) for which to generate the summary. Default is 1 (one month ago). |
type |
A character string indicating the type of summary
to return. Options are |
This function returns summaries about the data holdings
within Neotoma using the existing Neotoma API's summary endpoint. This can
provide information about recent uploads (the number of new sites
uploaded within the last month, for example), or can be used to provide
information about the overall number of sites/datasets (using an arbitrarily
high value for end).
data.frame with summary statistics
Socorro Dominguez [email protected]
Simon Goring [email protected]
## Not run: tryCatch({ last_month <- get_stats(start = 0, end = 1, type = "dsdbmonth") }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)## Not run: tryCatch({ last_month <- get_stats(start = 0, end = 1, type = "dsdbmonth") }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)
Call Neotoma and return a table (with limits & offsets for large tables)
get_table(x, limit = 25, offset = 0)get_table(x, limit = 25, offset = 0)
x |
Table name (consult https://open.neotomadb.org/dbschema/ for a complete list of table names. |
limit |
Default 25 records |
offset |
Default 0. |
selected table values from the Database.
## Not run: # Returns only the first 25 specimen records. someSpec <- get_table('specimens') ## End(Not run)## Not run: # Returns only the first 25 specimen records. someSpec <- get_table('specimens') ## End(Not run)
a sites object with sites that contain the requested taxa.
get_taxa(x = NA, ...) ## S3 method for class 'numeric' get_taxa(x, ...) ## Default S3 method: get_taxa(...)get_taxa(x = NA, ...) ## S3 method for class 'numeric' get_taxa(x, ...) ## Default S3 method: get_taxa(...)
x |
A |
... |
accepted arguments, see details for more information. |
The get_taxa function searches for a sites within Neotoma
that contain the requested taxa.
The get_taxa command wraps the Neotoma API'.
The call itself accepts any one of the following
parameters:
taxonid The unique taxon ID (integer) in Neotoma. Can be passed as a
vector of site IDs.
A Neotoma2 sites object with datasets with the requested taxa.
Socorro Dominguez [email protected]
a taxon object with detailed information
get_taxon(x = NA, ...) ## Default S3 method: get_taxon(...) ## S3 method for class 'numeric' get_taxon(x, ...)get_taxon(x = NA, ...) ## Default S3 method: get_taxon(...) ## S3 method for class 'numeric' get_taxon(x, ...)
x |
taxon ID |
... |
accepted arguments, see details for more information. |
A taxa may have one or more taxa associated with it.
The get_taxon function searches for taxa detail data within Neotoma
while the get_taxa function searches for sites that contain the requested
taxa. The function searches for each taxon by using a SQL query which
accepts any one of the following parameters:
taxonid The unique taxon ID (integer) in Neotoma. Can be passed as a
vector of taxa IDs.
taxonname Taxon name or partial name. You can pass wildcard characters
using %.
taxagroup The taxonomic grouping the taxon belongs to, from the Neotoma
taxagrouptypes table.
ecolgroup The ecological group of interest for the Neotoma taxon (from
the Neotoma ecolgrouptypes table)
status The taxonomic extinction status of the taxon, either extinct
(1, True) or extant (0, False).
A Neotoma2 taxa object with datasets with the requested taxa.
Socorro Dominguez [email protected]
This function parses a site object, from site to
dataset level and returns a data.frame that contains the
site, collectionunit and dataset IDs for each element within the site.
getids(x, order = TRUE) ## S3 method for class 'sites' getids(x, order = TRUE) ## S3 method for class 'site' getids(x, order = TRUE) ## S3 method for class 'collunits' getids(x, order = TRUE) ## S3 method for class 'collunit' getids(x, order = TRUE)getids(x, order = TRUE) ## S3 method for class 'sites' getids(x, order = TRUE) ## S3 method for class 'site' getids(x, order = TRUE) ## S3 method for class 'collunits' getids(x, order = TRUE) ## S3 method for class 'collunit' getids(x, order = TRUE)
x |
A Neotoma2 |
order |
sort items by |
data.frame containing siteid, datasetid, and collunitid
Simon Goring [email protected]
## Not run: marion <- get_sites(sitename = "Marion Lake") collunitids <- getids(collunits(marion)) ## End(Not run)## Not run: marion <- get_sites(sitename = "Marion Lake") collunitids <- getids(collunits(marion)) ## End(Not run)
length
## S4 method for signature 'chronologies' length(x) ## S4 method for signature 'collunits' length(x) ## S4 method for signature 'contacts' length(x) ## S4 method for signature 'datasets' length(x) ## S4 method for signature 'publications' length(x) ## S4 method for signature 'samples' length(x) ## S4 method for signature 'sites' length(x) ## S4 method for signature 'speleothems' length(x) ## S4 method for signature 'taxa' length(x)## S4 method for signature 'chronologies' length(x) ## S4 method for signature 'collunits' length(x) ## S4 method for signature 'contacts' length(x) ## S4 method for signature 'datasets' length(x) ## S4 method for signature 'publications' length(x) ## S4 method for signature 'samples' length(x) ## S4 method for signature 'sites' length(x) ## S4 method for signature 'speleothems' length(x) ## S4 method for signature 'taxa' length(x)
x |
|
int representing length of a neotoma2 object
neotoma2 object's slot namesGet all names for elements' slots within a collunit object.
## S4 method for signature 'collunit' names(x) ## S4 method for signature 'contact' names(x) ## S4 method for signature 'dataset' names(x) ## S4 method for signature 'publication' names(x) ## S4 method for signature 'publications' names(x) ## S4 method for signature 'site' names(x) ## S4 method for signature 'sites' names(x) ## S4 method for signature 'speleothem' names(x) ## S4 method for signature 'taxon' names(x)## S4 method for signature 'collunit' names(x) ## S4 method for signature 'contact' names(x) ## S4 method for signature 'dataset' names(x) ## S4 method for signature 'publication' names(x) ## S4 method for signature 'publications' names(x) ## S4 method for signature 'site' names(x) ## S4 method for signature 'sites' names(x) ## S4 method for signature 'speleothem' names(x) ## S4 method for signature 'taxon' names(x)
x |
A |
NULL.
A quick function to test whether or not the Neotoma Database API is currently running.
pingNeotoma(server = "neotoma")pingNeotoma(server = "neotoma")
server |
One of |
A valid HTTP status code or returns an error if a connection is refused.
## Not run: test_connection <- pingNeotoma("neotoma") ## End(Not run)## Not run: test_connection <- pingNeotoma("neotoma") ## End(Not run)
Plot site coordinates using a basic plot.
## S4 method for signature 'sites' plot(x, y, ...) ## S4 method for signature 'site' plot(x, y, ...)## S4 method for signature 'sites' plot(x, y, ...) ## S4 method for signature 'site' plot(x, y, ...)
x |
sites object |
y |
Ignored. |
... |
Additional parameters associated with the call. |
plot object with site coordinates.
Plot sites on a leaflet map
plotLeaflet(object) ## S4 method for signature 'site' plotLeaflet(object) ## S4 method for signature 'ANY' plotLeaflet(object)plotLeaflet(object) ## S4 method for signature 'site' plotLeaflet(object) ## S4 method for signature 'ANY' plotLeaflet(object)
object |
Sites object to plot |
leaflet map with site markers
Socorro Dominguez [email protected]
Plot sites on a leaflet map
## S4 method for signature 'sites' plotLeaflet(object)## S4 method for signature 'sites' plotLeaflet(object)
object |
Sites object to plot |
leaflet map
## Not run: # Note that by default the limit for queries is 25 records: tryCatch({ modernSites <- get_sites(keyword = "Modern") plotLeaflet(modernSites) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)## Not run: # Note that by default the limit for queries is 25 records: tryCatch({ modernSites <- get_sites(keyword = "Modern") plotLeaflet(modernSites) }, error = function(e) { message("Neotoma server not responding. Try again later.") }) ## End(Not run)
publications.A publication is liked to an individual Neotoma dataset object
They are grouped using an S4 publications class.
This publications class allows a single dataset to have one
or more publication classes associated with it.
object of class publication
{ simon <- new("contact", familyname = "Goring", givennames = "Simon J.") socorro <- new("contact", familyname = "Dominguez", givennames = "Socorro") first_author <- new("author", author = simon, order = 1) second_author <- new("author", author = socorro, order = 2) author_list <- new("authors", authors = list(first_author, second_author)) pub <- new("publication", articletitle = "Top or bottom: Best toast spreading surfaces.", journal = "Peanut Butter Science", year = "2022", volume = "2", author = author_list) }{ simon <- new("contact", familyname = "Goring", givennames = "Simon J.") socorro <- new("contact", familyname = "Dominguez", givennames = "Socorro") first_author <- new("author", author = simon, order = 1) second_author <- new("author", author = socorro, order = 2) author_list <- new("authors", authors = list(first_author, second_author)) pub <- new("publication", articletitle = "Top or bottom: Best toast spreading surfaces.", journal = "Peanut Butter Science", year = "2022", volume = "2", author = author_list) }
repository informationThe standard object class for repository
from the Neotoma Paleoecology Database.
object of class repository
Obtain samples from a record or multiple records.
samples(x) ## S4 method for signature 'site' samples(x) ## S4 method for signature 'collunits' samples(x) ## S4 method for signature 'collunit' samples(x)samples(x) ## S4 method for signature 'site' samples(x) ## S4 method for signature 'collunits' samples(x) ## S4 method for signature 'collunit' samples(x)
x |
sites object |
data.frame with record information at sample level
samples informationThe standard object class for samples
in the Neotoma Paleoecology Database.
object of class sample
Obtain all samples within a sites object
## S4 method for signature 'sites' samples(x)## S4 method for signature 'sites' samples(x)
x |
sites object |
data.frame with sample records
Socorro Dominguez [email protected]
Simon Goring [email protected]
## Not run: # Get full data download from API and create a long table with samples data. dw <- get_downloads(1) pollen <- samples(dw) ## End(Not run)## Not run: # Get full data download from API and create a long table with samples data. dw <- get_downloads(1) pollen <- samples(dw) ## End(Not run)
Create a new chronology for a record. Within Neotoma all chronologies have unique numeric identifiers. Within R, because of the need to use the identifiers across objects, and because we want to avoid conflicts between naming systems, a universally unique identifier (UUID) is created for the object ID.
Function to create new chronology objects for personal analysis. The new object will not be uploaded to the database.
set_chronology( x = NA, chronologyid = NA_integer_, notes = NA_character_, contact = list(), agemodel = NA_character_, ageboundolder = NA_integer_, ageboundyounger = NA_integer_, isdefault = NA_integer_, dateprepared = as.Date(character(0)), modelagetype = NA_character_, chronologyname = NA_character_, chroncontrols = data.frame(0) )set_chronology( x = NA, chronologyid = NA_integer_, notes = NA_character_, contact = list(), agemodel = NA_character_, ageboundolder = NA_integer_, ageboundyounger = NA_integer_, isdefault = NA_integer_, dateprepared = as.Date(character(0)), modelagetype = NA_character_, chronologyname = NA_character_, chroncontrols = data.frame(0) )
x |
Object to be set as a chronology |
chronologyid |
An optional value. Will be assigned a unique identifier if not provided. |
notes |
Additional notes about the chronology. For more modern models, often the function call to Bacon or Bchron is added here. |
contact |
A contacts object, identifying the individual(s) who created the chronology |
agemodel |
A string representing the age model name, for example "Crummy linear interpolation". |
ageboundolder |
The |
ageboundyounger |
The |
isdefault |
Defines whether the model is the default for the collection unit for a particular model age type. |
dateprepared |
The date at which the age model was prepared. |
modelagetype |
The age type for the model. For validation, the models
should be one of the valid Neotoma |
chronologyname |
A valid name for the chronology. |
chroncontrols |
A data.frame containing the chronological controls for the age model. |
chronology object
Socorro Dominguez [email protected]
Simon Goring [email protected]
Function to create new collection unit objects for personal analysis. The new object will not be uploaded to the database.
set_collunit( x = NA, collectionunitid = NA_integer_, notes = NA_character_, handle = NA_character_, colldate = as.Date(character(1)), location = NA_character_, waterdepth = NA_integer_, gpslocation = st_as_sf(st_sfc()), collunittype = NA_character_, collectiondevice = NA_character_, collectionunitname = NA_character_, depositionalenvironment = NA_character_, datasets = NULL, chronologies = NULL, defaultchronology = NA_integer_, speleothems = NULL )set_collunit( x = NA, collectionunitid = NA_integer_, notes = NA_character_, handle = NA_character_, colldate = as.Date(character(1)), location = NA_character_, waterdepth = NA_integer_, gpslocation = st_as_sf(st_sfc()), collunittype = NA_character_, collectiondevice = NA_character_, collectionunitname = NA_character_, depositionalenvironment = NA_character_, datasets = NULL, chronologies = NULL, defaultchronology = NA_integer_, speleothems = NULL )
x |
object to be set as collunit |
collectionunitid |
collection unit identifier |
notes |
notes |
handle |
handle |
colldate |
collection date |
location |
location of the collection unit |
waterdepth |
depth at where the sample is taken |
gpslocation |
location with GPS |
collunittype |
type of collection unit |
collectiondevice |
device used to collect the sample |
collectionunitname |
name of the collection unit |
depositionalenvironment |
depositional environment |
datasets |
datasets that the collection unit has |
chronologies |
chronologies taken from the collection unit |
defaultchronology |
best chronology model identifier to be used with this collection unit |
speleothems |
speleothems associated with the collection unit |
collunit object
Socorro Dominguez [email protected]
Simon Goring [email protected]
{ # Create a collunit my_collunit <- set_collunit(notes = "my lake") }{ # Create a collunit my_collunit <- set_collunit(notes = "my lake") }
Create a new contact for a record. Within Neotoma all chronologies have unique numeric identifiers. Within R, because of the need to use the indentifiers across objects, and because we want to avoid conflicts between naming systems, a universally unique identifier (UUID) is created for the object ID.This is not to be updated to the database.
set_contact( x = NA, contactid = NA_integer_, familyname = NA_character_, leadinginitials = NA_character_, givennames = NA_character_, contactname = NA_character_, suffix = NA_character_, ORCID = NA_character_, title = NA_character_, institution = NA_character_, email = NA_character_, phone = NA_character_, contactstatus = NA_character_, fax = NA_character_, url = NA_character_, address = NA_character_, notes = NA_character_ )set_contact( x = NA, contactid = NA_integer_, familyname = NA_character_, leadinginitials = NA_character_, givennames = NA_character_, contactname = NA_character_, suffix = NA_character_, ORCID = NA_character_, title = NA_character_, institution = NA_character_, email = NA_character_, phone = NA_character_, contactstatus = NA_character_, fax = NA_character_, url = NA_character_, address = NA_character_, notes = NA_character_ )
x |
Object to be set as a contact |
contactid |
An arbitrary Contact identification number. |
familyname |
Family or surname name of a person. |
leadinginitials |
Leading initials for given or forenames
without spaces (e.g. |
givennames |
Given or forenames of a person (e.g.
|
contactname |
Full name of a person (e.g. |
suffix |
Suffix of a person’s name (e.g. |
ORCID |
A unique ORCID (see https://orcid.org). |
title |
A person’s title (e.g. |
institution |
The institution where an individual works. |
email |
An individuals email address |
phone |
Their phone number |
contactstatus |
Are they "active" or "retired"? |
fax |
Do people still use fax machines? |
url |
Their homepage |
address |
A physical address |
notes |
Notes about the individual |
contact object
Function to create new dataset objects for personal analysis.
The new object will not be uploaded to the database.
set_dataset( x = NA, datasetid = NA_integer_, datasetname = NA_character_, database = NA_character_, doi = NA, recdatecreated = as.Date(character(1)), datasettype = NA_character_, age_range_old = NA_integer_, age_range_young = NA_integer_, age_units = NA_character_, notes = NA_character_, pi_list = NA, samples = NULL, specimens = NULL )set_dataset( x = NA, datasetid = NA_integer_, datasetname = NA_character_, database = NA_character_, doi = NA, recdatecreated = as.Date(character(1)), datasettype = NA_character_, age_range_old = NA_integer_, age_range_young = NA_integer_, age_units = NA_character_, notes = NA_character_, pi_list = NA, samples = NULL, specimens = NULL )
x |
object to be set as dataset, |
datasetid |
dataset identifier |
datasetname |
name of the dataset |
database |
dataset where the dataset came from |
doi |
DOI |
recdatecreated |
date the dataset was created |
datasettype |
type the dataset belongs to |
age_range_old |
age range old |
age_range_young |
age range young |
age_units |
age units |
notes |
notes |
pi_list |
pi list |
samples |
taxa objects |
specimens |
specimens slot |
dataset object
Socorro Dominguez [email protected]
{ # Create a dataset my_dataset <- set_dataset(database = "EPD", datasettype = "pollen", notes = "my lake") }{ # Create a dataset my_dataset <- set_dataset(database = "EPD", datasettype = "pollen", notes = "my lake") }
Set the default chronology within a collectionunit.
set_default(x, n)set_default(x, n)
x |
A chronologies object. |
n |
The particular chronology to be used as the default. |
sites object with new default chronology
Change the default age model for a record.
## S4 method for signature 'chronologies' set_default(x, n)## S4 method for signature 'chronologies' set_default(x, n)
x |
A chronologies object. |
n |
The particular chronology to be used as the default. |
chronologies object with a new defaulted chronology
A function to create new publication objects by hand.
set_publication( x = NA, publicationid = NA_integer_, publicationtypeid = NA_integer_, publicationtype = NA_character_, year = NA_character_, citation = NA_character_, articletitle = NA_character_, journal = NA_character_, volume = NA_character_, issue = NA_character_, pages = NA_character_, citationnumber = NA_character_, doi = NA_character_, booktitle = NA_character_, numvolumes = NA_character_, edition = NA_character_, volumetitle = NA_character_, seriestitle = NA_character_, seriesvolume = NA_character_, publisher = NA_character_, url = NA_character_, city = NA_character_, state = NA_character_, country = NA_character_, originallanguage = NA_character_, notes = NA_character_, author = NULL )set_publication( x = NA, publicationid = NA_integer_, publicationtypeid = NA_integer_, publicationtype = NA_character_, year = NA_character_, citation = NA_character_, articletitle = NA_character_, journal = NA_character_, volume = NA_character_, issue = NA_character_, pages = NA_character_, citationnumber = NA_character_, doi = NA_character_, booktitle = NA_character_, numvolumes = NA_character_, edition = NA_character_, volumetitle = NA_character_, seriestitle = NA_character_, seriesvolume = NA_character_, publisher = NA_character_, url = NA_character_, city = NA_character_, state = NA_character_, country = NA_character_, originallanguage = NA_character_, notes = NA_character_, author = NULL )
x |
"publications" object to be updated. |
publicationid |
ID of publication |
publicationtypeid |
ID of kind of publication |
publicationtype |
A text string identifying the publication type within the Neotoma database. |
year |
The year of publication. |
citation |
A full text citation for the article. |
articletitle |
The title of the article. |
journal |
The journal in which the article was published. |
volume |
The journal volume. |
issue |
The journal issue. |
pages |
The pages of the journal. |
citationnumber |
How many times has the paper been cited? |
doi |
A DOI for the record. |
booktitle |
The title of the book (if the publication is a book) |
numvolumes |
The number of book volumes (if a series) |
edition |
The book edition. |
volumetitle |
The title of the volume (in a published series) |
seriestitle |
The title of the series. |
seriesvolume |
The series volume. |
publisher |
The publisher. |
url |
Publication URL |
city |
City of publication. |
state |
State of publication. |
country |
Country of publication. |
originallanguage |
Original language of publication. |
notes |
Publication notes. |
author |
name of the author of publication. |
publication object
Simon Goring [email protected]
Socorro Dominguez [email protected]
Function to create new samples objects for analysis. The new object will not be uploaded to the database.
set_sample( x = NA, ages = list(), igsn = NA_character_, datum = data.frame(), depth = NA_integer_, sampleid = NA_integer_, thickness = NA_integer_, samplename = NA_character_, sampleanalyst = list(), analysisunitid = NA_integer_, analysisunitname = NA_character_ )set_sample( x = NA, ages = list(), igsn = NA_character_, datum = data.frame(), depth = NA_integer_, sampleid = NA_integer_, thickness = NA_integer_, samplename = NA_character_, sampleanalyst = list(), analysisunitid = NA_integer_, analysisunitname = NA_character_ )
x |
Object to be set as a sample |
ages |
ages |
igsn |
IGSN character |
datum |
dataframe of datum |
depth |
integer representing depth |
sampleid |
ID for sample |
thickness |
thickness of core |
samplename |
sample's name |
sampleanalyst |
Analyst's contact name |
analysisunitid |
Which analysis unit it is |
analysisunitname |
Analysis Unit's name |
sample object
Socorro Dominguez [email protected]
{ # Set an empty sample my_sample <- set_sample() }{ # Set an empty sample my_sample <- set_sample() }
Choose to pull Neotoma data from the main Neotoma server, the development server or from a local instance of the API.
set_server(server = "neotoma")set_server(server = "neotoma")
server |
One of |
NULL modifies how to talk to the API (local, dev, server)
Simon Goring [email protected]
## Not run: # The user is running the API locally using the node/express API # cloned from github: https://github.com/NeotomaDB/api_nodetest set_server(server = "local") # The user switches back to the remote api server. set_server(server = "neotoma") ## End(Not run)## Not run: # The user is running the API locally using the node/express API # cloned from github: https://github.com/NeotomaDB/api_nodetest set_server(server = "local") # The user switches back to the remote api server. set_server(server = "neotoma") ## End(Not run)
set Site Information for Fossil Sites
set_site( x = NA, siteid = NA_integer_, sitename = NA_character_, geography = sf::st_as_sf(sf::st_sfc()), altitude = NA_integer_, geopolitical = list(), area = NA_integer_, notes = NA_character_, description = NA_character_, collunits = NULL )set_site( x = NA, siteid = NA_integer_, sitename = NA_character_, geography = sf::st_as_sf(sf::st_sfc()), altitude = NA_integer_, geopolitical = list(), area = NA_integer_, notes = NA_character_, description = NA_character_, collunits = NULL )
x |
Object to be set as a site |
siteid |
The unique |
sitename |
Name of a site. |
geography |
A |
altitude |
altitude/elevation of the site. |
geopolitical |
The geopolitical unit in which the site is located. |
area |
The area of the site or depositional basin in ha. Can be calculated from the polygon. |
notes |
additional information of the site |
description |
Function to create new site objects. The new object will not be uploaded to the database. |
collunits |
Collection units in the site |
site object
Socorro Dominguez [email protected]
{ # Create a site called "My Lake", to x <- sf::st_as_sf(sf::st_sfc(sf::st_point(c(5,5)))) my_site <- set_site(sitename = "My Lake", geography = x, description = "my lake", altitude = 30) }{ # Create a site called "My Lake", to x <- sf::st_as_sf(sf::st_sfc(sf::st_point(c(5,5)))) my_site <- set_site(sitename = "My Lake", geography = x, description = "my lake", altitude = 30) }
Set Speleothem
set_speleothem( x = NA, entityid = NA_integer_, entityname = NA_character_, siteid = NA_integer_, collectionunitid = NA_integer_, dripheight = NA_integer_, monitoring = FALSE, geology = NA_character_, relativeage = NA_character_, speleothemtype = NA_character_, dripheightunits = NA_character_, entitycovertype = NA_character_, entrancedistance = NA_integer_, landusecovertype = NA_character_, speleothemdriptype = NA_character_, landusecoverpercent = NA_integer_, vegetationcovertype = NA_character_, entitycoverthickness = NA_integer_, entrancedistanceunits = NA_character_, vegetationcoverpercent = NA_integer_ )set_speleothem( x = NA, entityid = NA_integer_, entityname = NA_character_, siteid = NA_integer_, collectionunitid = NA_integer_, dripheight = NA_integer_, monitoring = FALSE, geology = NA_character_, relativeage = NA_character_, speleothemtype = NA_character_, dripheightunits = NA_character_, entitycovertype = NA_character_, entrancedistance = NA_integer_, landusecovertype = NA_character_, speleothemdriptype = NA_character_, landusecoverpercent = NA_integer_, vegetationcovertype = NA_character_, entitycoverthickness = NA_integer_, entrancedistanceunits = NA_character_, vegetationcoverpercent = NA_integer_ )
x |
Object to be set as a speleothem |
entityid |
The speleothem entity ID. |
entityname |
Name of the speleothem entity. |
siteid |
The unique site ID for a site. |
collectionunitid |
The unique collection unit ID for a collection unit. |
dripheight |
drip height |
monitoring |
Is the speleothem being monitored? TRUE/FALSE |
geology |
rock type of the speleothem |
relativeage |
relative age of the speleothem |
speleothemtype |
type of speleothem |
dripheightunits |
Units for drip height |
entitycovertype |
type of cover around the speleothem |
entrancedistance |
distance from cave entrance |
landusecovertype |
type of land use cover around the speleothem |
speleothemdriptype |
type of speleothem drip |
landusecoverpercent |
land use cover percent |
vegetationcovertype |
type of vegetation cover around the speleothem |
entitycoverthickness |
thickness of the entity cover |
entrancedistanceunits |
Units for distance from cave entrance |
vegetationcoverpercent |
vegetation cover percent |
speleothem object
Socorro Dominguez [email protected]
sites object or nested slots.Display a sites object or nested slots.
## S4 method for signature 'collunits' show(object) ## S4 method for signature 'collunit' show(object) ## S4 method for signature 'contacts' show(object) ## S4 method for signature 'contact' show(object) ## S4 method for signature 'dataset' show(object) ## S4 method for signature 'datasets' show(object) ## S4 method for signature 'publications' show(object) ## S4 method for signature 'publication' show(object) ## S4 method for signature 'site' show(object) ## S4 method for signature 'sites' show(object) ## S4 method for signature 'speleothem' show(object) ## S4 method for signature 'speleothems' show(object) ## S4 method for signature 'taxon' show(object) ## S4 method for signature 'taxa' show(object)## S4 method for signature 'collunits' show(object) ## S4 method for signature 'collunit' show(object) ## S4 method for signature 'contacts' show(object) ## S4 method for signature 'contact' show(object) ## S4 method for signature 'dataset' show(object) ## S4 method for signature 'datasets' show(object) ## S4 method for signature 'publications' show(object) ## S4 method for signature 'publication' show(object) ## S4 method for signature 'site' show(object) ## S4 method for signature 'sites' show(object) ## S4 method for signature 'speleothem' show(object) ## S4 method for signature 'speleothems' show(object) ## S4 method for signature 'taxon' show(object) ## S4 method for signature 'taxa' show(object)
object |
|
sites informationThe S4 class for sites in the Neotoma Paleoecology Database.
object of class sites
specimens informationThe standard object class for specimens
from the Neotoma Paleoecology Database.
object of class specimens
Obtain speleothems and samples from a record or multiple records.
speleothemdetails(x) ## S4 method for signature 'site' speleothemdetails(x) ## S4 method for signature 'collunits' speleothemdetails(x) ## S4 method for signature 'collunit' speleothemdetails(x)speleothemdetails(x) ## S4 method for signature 'site' speleothemdetails(x) ## S4 method for signature 'collunits' speleothemdetails(x) ## S4 method for signature 'collunit' speleothemdetails(x)
x |
sites object |
data.frame with record information at speleothem level
Obtain elements on the speleothems level Experimental function: API and behavior may change.
## S4 method for signature 'sites' speleothemdetails(x)## S4 method for signature 'sites' speleothemdetails(x)
x |
site object |
data.frame with speleothem records
Socorro Dominguez [email protected]
## Not run: kesang <- get_sites(sitename = "Kesang cave") %>% get_datasets() %>% filter(datasettype == "pollen") %>% get_speleothems() sp <- speleothemdetails(kesang) ## End(Not run)## Not run: kesang <- get_sites(sitename = "Kesang cave") %>% get_datasets() %>% filter(datasettype == "pollen") %>% get_speleothems() sp <- speleothemdetails(kesang) ## End(Not run)
Obtain speleothems from a record or multiple records.
speleothems(x) ## S4 method for signature 'site' speleothems(x) ## S4 method for signature 'collunits' speleothems(x) ## S4 method for signature 'collunit' speleothems(x)speleothems(x) ## S4 method for signature 'site' speleothems(x) ## S4 method for signature 'collunits' speleothems(x) ## S4 method for signature 'collunit' speleothems(x)
x |
sites object |
data.frame with record information at speleothem level
speleothem informationThe S4 class for speleothem data.
object of class speleothems
Obtain all speleothems within a sites object Experimental function: API and behavior may change.
## S4 method for signature 'sites' speleothems(x)## S4 method for signature 'sites' speleothems(x)
x |
sites object |
data.frame with sample records
Socorro Dominguez [email protected]
## Not run: ds <- get_datasets(37302) sp <- speleothems(ds) ## End(Not run)## Not run: ds <- get_datasets(37302) sp <- speleothems(ds) ## End(Not run)
This function summarizes a sites object, from site level
and returns a data.frame that contains the site ID, sitename,
collectionunit ID, count of chronologies, count of datasets
and types of datasets within the site.
## S4 method for signature 'sites' summary(object, ...)## S4 method for signature 'sites' summary(object, ...)
object |
sites object |
... |
additional properties passed to |
data.frame object with site summary information
Show the samples table
taxa(object) ## S4 method for signature 'site' taxa(object) ## S4 method for signature 'collunits' taxa(object) ## S4 method for signature 'collunit' taxa(object)taxa(object) ## S4 method for signature 'site' taxa(object) ## S4 method for signature 'collunits' taxa(object) ## S4 method for signature 'collunit' taxa(object)
object |
Sites object to extract taxa table from |
data.frame with taxa records
Taxa details from the Neotoma Paleoecology Database.
object of class taxon
Extract taxonomic data from a set of sites.
## S4 method for signature 'sites' taxa(object)## S4 method for signature 'sites' taxa(object)
object |
A |
A data.frame reporting the taxa/data objects, units,
elements and other features within a set of records.
Socorro Dominguez [email protected]
## Not run: somesites <- get_sites(datasettype = "diatom") %>% get_downloads() diatomtaxa <- taxa(somesites) ## End(Not run)## Not run: somesites <- get_sites(datasettype = "diatom") %>% get_downloads() diatomtaxa <- taxa(somesites) ## End(Not run)
Obtain a wide table with information regarding of samples grouped by variablename and depth/age.
toWide( x, variablenames = NA, ecologicalgroups = NA, elementtypes = NA, unit = NA, groupby = "age", operation = "prop" )toWide( x, variablenames = NA, ecologicalgroups = NA, elementtypes = NA, unit = NA, groupby = "age", operation = "prop" )
x |
dataframe object with samples |
variablenames |
Optional vector to filter by specific variable names. |
ecologicalgroups |
Vector stating the ecological groups to be filtered by, e.g "DIAT", "TRSH" |
elementtypes |
Label of element type to filter by, e.g. "pollen", "valve" |
unit |
Label stating which units to filter by, e.g. "NISP" |
groupby |
Group by 'age' or 'depth' |
operation |
label or vector of operations to be chosen from: 'prop', 'sum', 'presence'. |
wide data.frame obtained from long samples data.frame
Socorro Dominguez [email protected]
## Not run: fc_sites <- neotoma2::get_datasets(limit=5, datasettype = "vertebrate fauna") fc_ds <- fc_sites %>% neotoma2::get_downloads() fc_dl1 <- fc_dl[[1]] fc_smp <- samples(fc_dl1) toWide(fc_smp, ecologicalgroups=c('AVES', 'RODE'), elementtypes='bone/tooth', unit='present/absent') ## End(Not run)## Not run: fc_sites <- neotoma2::get_datasets(limit=5, datasettype = "vertebrate fauna") fc_ds <- fc_sites %>% neotoma2::get_downloads() fc_dl1 <- fc_dl[[1]] fc_smp <- samples(fc_dl1) toWide(fc_smp, ecologicalgroups=c('AVES', 'RODE'), elementtypes='bone/tooth', unit='present/absent') ## End(Not run)