Title: | Working with the Neotoma Paleoecology Database |
---|---|
Description: | Access and manipulation of data using the Neotoma Paleoecology Database. <https://api.neotomadb.org/api-docs/>. |
Authors: | Dominguez Vidana Socorro [aut, cre] , Simon Goring [aut] |
Maintainer: | Dominguez Vidana Socorro <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.0.4 |
Built: | 2024-11-12 05:57:48 UTC |
Source: | https://github.com/neotomadb/neotoma2 |
Retrieve sites by numeric index
## S4 method for signature 'collunits,numeric' x[i]
## S4 method for signature 'collunits,numeric' x[i]
x |
The collunits object |
i |
The numeric index |
null used for side effects. Printing a data.frame
Retrieve sites by numeric index
## S4 method for signature 'collunits,numeric,ANY' x[i]
## S4 method for signature 'collunits,numeric,ANY' x[i]
x |
The collunits object |
i |
The numeric index |
null used for side effects. Printing a data.frame
Get or remove datasets by numeric index
## S4 method for signature 'datasets,numeric' x[i]
## S4 method for signature 'datasets,numeric' x[i]
x |
The datasets object |
i |
The numeric index |
Get or remove datasets
by numeric index
Get or remove datasets by numeric index
## S4 method for signature 'datasets,numeric,ANY' x[i]
## S4 method for signature 'datasets,numeric,ANY' x[i]
x |
The datasets object |
i |
The numeric index |
Get or remove datasets
by numeric index
Get site field by character index
## S4 method for signature 'site,character' x[i]
## S4 method for signature 'site,character' x[i]
x |
The site object |
i |
The column indicator |
sliced site
object
Get site field by character index
## S4 method for signature 'site,character,ANY' x[i]
## S4 method for signature 'site,character,ANY' x[i]
x |
The site object |
i |
The column indicator |
sliced site
object
Get site field by numeric index
## S4 method for signature 'site,numeric' x[i]
## S4 method for signature 'site,numeric' x[i]
x |
The site object |
i |
The column indicator |
sliced site
object
Get site field by numeric index
## S4 method for signature 'site,numeric,ANY' x[i]
## S4 method for signature 'site,numeric,ANY' x[i]
x |
The site object |
i |
The column indicator |
sliced site
object
Get or remove sites by numeric index
## S4 method for signature 'sites,numeric' x[i]
## S4 method for signature 'sites,numeric' x[i]
x |
The sites object |
i |
The numeric index |
sliced site
object
Get or remove sites by numeric index
## S4 method for signature 'sites,numeric,ANY' x[i]
## S4 method for signature 'sites,numeric,ANY' x[i]
x |
The sites object |
i |
The numeric index |
sliced site
object
Get or remove specimens by numeric index
## S4 method for signature 'specimens,numeric' x[i]
## S4 method for signature 'specimens,numeric' x[i]
x |
The specimens object |
i |
The numeric index |
sliced specimens
object
Get or remove specimens by numeric index
## S4 method for signature 'specimens,numeric,ANY' x[i]
## S4 method for signature 'specimens,numeric,ANY' x[i]
x |
The specimens object |
i |
The numeric index |
sliced specimens
object
Obtain one of the elements within a chronologies
list
either by element order or by element name.
## S4 method for signature 'chronologies,numeric' x[[i]]
## S4 method for signature 'chronologies,numeric' x[[i]]
x |
chronologies object |
i |
iteration in chronologies list |
selected chronology
object
Obtain one of the elements within a chronologies
list
either by element order or by element name.
## S4 method for signature 'chronologies,numeric,ANY' x[[i]]
## S4 method for signature 'chronologies,numeric,ANY' x[[i]]
x |
chronologies object |
i |
iteration in chronologies list |
selected chronology
object
Obtain one of the elements within a collunits list
## S4 method for signature 'collunits,numeric' x[[i]]
## S4 method for signature 'collunits,numeric' x[[i]]
x |
collunits object |
i |
iteration in collunits list |
sliced collunits
object
Obtain one of the elements within a collunits list
## S4 method for signature 'collunits,numeric,ANY' x[[i]]
## S4 method for signature 'collunits,numeric,ANY' x[[i]]
x |
collunits object |
i |
iteration in collunits list |
sliced collunits
object
Extract or Replace Parts of an Object
## S4 method for signature 'contacts,numeric' x[[i]]
## S4 method for signature 'contacts,numeric' x[[i]]
x |
A contact object. |
i |
The numeric index of a contact slot. |
sliced contacts
Extract or Replace Parts of an Object
## S4 method for signature 'contacts,numeric,ANY' x[[i]]
## S4 method for signature 'contacts,numeric,ANY' x[[i]]
x |
A contact object. |
i |
The numeric index of a contact slot. |
sliced contacts
Obtain one of the elements within a datasets list
## S4 method for signature 'datasets,numeric' x[[i]]
## S4 method for signature 'datasets,numeric' x[[i]]
x |
datasets object |
i |
iteration in datasets list |
sliced dataset
object
Obtain one of the elements within a datasets list
## S4 method for signature 'datasets,numeric,ANY' x[[i]]
## S4 method for signature 'datasets,numeric,ANY' x[[i]]
x |
datasets object |
i |
iteration in datasets list |
sliced dataset
object
Obtain one of the elements within a publication list.
## S4 method for signature 'publications,numeric' x[[i]]
## S4 method for signature 'publications,numeric' x[[i]]
x |
A publications object. |
i |
A numeric index for the requested publication |
selected publications
object from index
Obtain one of the elements within a publication list.
## S4 method for signature 'publications,numeric,ANY' x[[i]]
## S4 method for signature 'publications,numeric,ANY' x[[i]]
x |
A publications object. |
i |
A numeric index for the requested publication |
selected publications
object from index
Obtain one of the elements within a samples list
## S4 method for signature 'samples,numeric' x[[i]]
## S4 method for signature 'samples,numeric' x[[i]]
x |
samples object |
i |
iteration in samples list |
samples
sliced object
Obtain one of the elements within a samples list
## S4 method for signature 'samples,numeric,ANY' x[[i]]
## S4 method for signature 'samples,numeric,ANY' x[[i]]
x |
samples object |
i |
iteration in samples list |
samples
sliced object
Obtain one of the elements within a sites list
## S4 method for signature 'sites,numeric' x[[i]]
## S4 method for signature 'sites,numeric' x[[i]]
x |
sites object |
i |
iteration in sites list |
sliced site
object
{ some_site <- get_sites(sitename = "Site%", limit=3) some_site[[2]] }
{ some_site <- get_sites(sitename = "Site%", limit=3) some_site[[2]] }
Obtain one of the elements within a sites list
## S4 method for signature 'sites,numeric,ANY' x[[i]]
## S4 method for signature 'sites,numeric,ANY' x[[i]]
x |
sites object |
i |
iteration in sites list |
sliced site
object
{ some_site <- get_sites(sitename = "Site%", limit=3) some_site[[2]] }
{ some_site <- get_sites(sitename = "Site%", limit=3) some_site[[2]] }
Obtain one of the elements within a specimens list
## S4 method for signature 'specimens,numeric' x[[i]]
## S4 method for signature 'specimens,numeric' x[[i]]
x |
specimens object |
i |
iteration in specimens list |
sliced specimens
object
Obtain one of the elements within a specimens list
## S4 method for signature 'specimens,numeric,ANY' x[[i]]
## S4 method for signature 'specimens,numeric,ANY' x[[i]]
x |
specimens object |
i |
iteration in specimens list |
sliced specimens
object
Obtain one of the elements within a collunits list
## S4 replacement method for signature 'collunits,ANY,ANY,ANY' x[[i]] <- value
## S4 replacement method for signature 'collunits,ANY,ANY,ANY' x[[i]] <- value
x |
collunits object |
i |
iteration in collunits list |
value |
The value to be used |
Modified collunits
Obtain one of the elements within a datasets list
## S4 replacement method for signature 'datasets,ANY,ANY,ANY' x[[i]] <- value
## S4 replacement method for signature 'datasets,ANY,ANY,ANY' x[[i]] <- value
x |
datasets object |
i |
iteration in datasets list |
value |
The value to be used |
One dataset
slot's value
Assign value to an element in a publication list.
## S4 replacement method for signature 'publications,ANY,ANY,ANY' x[[i]] <- value
## S4 replacement method for signature 'publications,ANY,ANY,ANY' x[[i]] <- value
x |
A publications object. |
i |
A numeric index for the requested publication |
value |
The value to be used |
publications
with new assigned value.
Obtain one of the elements within a sites list
## S4 replacement method for signature 'sites,ANY,ANY,ANY' x[[i]] <- value
## S4 replacement method for signature 'sites,ANY,ANY,ANY' x[[i]] <- value
x |
sites object |
i |
iteration in sites list |
value |
The value to be used |
sites
object with reassigned values
Obtain one of the elements within a specimens list
## S4 replacement method for signature 'specimens,ANY,ANY,ANY' x[[i]] <- value
## S4 replacement method for signature 'specimens,ANY,ANY,ANY' x[[i]] <- value
x |
specimens object |
i |
iteration in specimens list |
value |
The value to be used |
specimens
object with reassigned values
Assign collunit field by numeric index
## S4 replacement method for signature 'collunit,character,ANY,ANY' x[i] <- value
## S4 replacement method for signature 'collunit,character,ANY,ANY' x[i] <- value
x |
The collunit object. |
i |
The column indicator. |
value |
The value to be used. |
sliced element
Assign collunit field by numeric index
## S4 replacement method for signature 'collunit,numeric,ANY,ANY' x[i] <- value
## S4 replacement method for signature 'collunit,numeric,ANY,ANY' x[i] <- value
x |
The collunit object. |
i |
The column indicator. |
value |
The value to be used. |
sliced value
Assign dataset field by numeric index
## S4 replacement method for signature 'dataset,character,ANY,ANY' x[i] <- value
## S4 replacement method for signature 'dataset,character,ANY,ANY' x[i] <- value
x |
The dataset object. |
i |
The column indicator. |
value |
The value to be used. |
dataset
slot with new assigned character value
Assign dataset field by numeric index
## S4 replacement method for signature 'dataset,numeric,ANY,ANY' x[i] <- value
## S4 replacement method for signature 'dataset,numeric,ANY,ANY' x[i] <- value
x |
The dataset object. |
i |
The column indicator. |
value |
The value to be used. |
dataset
slot with new assigned numeric value
Assign site field by numeric index
## S4 replacement method for signature 'site,character,ANY,ANY' x[i] <- value
## S4 replacement method for signature 'site,character,ANY,ANY' x[i] <- value
x |
The site object. |
i |
The column indicator. |
value |
The value to be used. |
site
object with reassigned character values
Assign site field by numeric index
## S4 replacement method for signature 'site,numeric,ANY,ANY' x[i] <- value
## S4 replacement method for signature 'site,numeric,ANY,ANY' x[i] <- value
x |
The site object. |
i |
The column indicator. |
value |
The value to be used. |
sites
object with reassigned numeric values
Assign specimen field by numeric index
## S4 replacement method for signature 'specimen,character,ANY,ANY' x[i] <- value
## S4 replacement method for signature 'specimen,character,ANY,ANY' x[i] <- value
x |
The specimen object. |
i |
The column indicator. |
value |
The value to be used. |
specimen
object with reassigned character values
Assign specimen field by numeric index
## S4 replacement method for signature 'specimen,numeric,ANY,ANY' x[i] <- value
## S4 replacement method for signature 'specimen,numeric,ANY,ANY' x[i] <- value
x |
The specimen object. |
i |
The column indicator. |
value |
The value to be used. |
sites
object with reassigned numeric values
Obtain chronology slots across all chronology elements within a chronologies object.
## S4 method for signature 'chronologies' x$name
## S4 method for signature 'chronologies' x$name
x |
chronologies object |
name |
name of the slot |
A multiple chronologies
Extract chronology metadata by slot name.
## S4 method for signature 'chronology' x$name
## S4 method for signature 'chronology' x$name
x |
chronology object |
name |
name of the slot |
value of the slot
name
Obtain slots of a collunit without using at-mark
## S4 method for signature 'collunit' x$name
## S4 method for signature 'collunit' x$name
x |
collunit object |
name |
name of the slot |
null prints element of a slot
Obtain slots of a collunit without using at-mark
## S4 method for signature 'collunits' x$name
## S4 method for signature 'collunits' x$name
x |
collunits object |
name |
name of the slot |
null prints element of a slot
Extract or Replace Parts of an Object
## S4 method for signature 'contact' x$name
## S4 method for signature 'contact' x$name
x |
A contact object. |
name |
The name of a contact slot. |
value in the selected slot
Extract or Replace Parts of an Object
## S4 method for signature 'contacts' x$name
## S4 method for signature 'contacts' x$name
x |
A contacts object. |
name |
The name of a contacts slot. |
object value from the slot
Obtain slots of a dataset without using at-mark
## S4 method for signature 'dataset' x$name
## S4 method for signature 'dataset' x$name
x |
dataset object |
name |
name of the slot |
Obtain a dataset
's slot
value using $
Obtain slots of a dataset without using at-mark
## S4 method for signature 'datasets' x$name
## S4 method for signature 'datasets' x$name
x |
datasets object |
name |
name of the slot. |
Obtain a datasets
' slot
value using $
publication
Extract an element from a publication
## S4 method for signature 'publication' x$name
## S4 method for signature 'publication' x$name
x |
A |
name |
The slot to obtain (e.g., |
value
in the selected slot
Obtain slots of a sample without using at-mark
## S4 method for signature 'sample' x$name
## S4 method for signature 'sample' x$name
x |
sample object |
name |
name of the slot |
value
at selected slot
Obtain slots of a site without using at-mark
## S4 method for signature 'samples' x$name
## S4 method for signature 'samples' x$name
x |
samples object |
name |
name of the slot |
value
at selected slot
Obtain slots of a site without using at-mark
## S4 method for signature 'site' x$name
## S4 method for signature 'site' x$name
x |
site object |
name |
name of the slot |
value at chosen slot in the site
object
Obtain slots of a site without using at-mark
## S4 method for signature 'sites' x$name
## S4 method for signature 'sites' x$name
x |
sites object |
name |
name of the slot |
value at chosen slot in the site
object
Obtain slots of a specimen without using at-mark
## S4 method for signature 'specimen' x$name
## S4 method for signature 'specimen' x$name
x |
specimen object |
name |
name of the slot |
value at chosen slot in the specimen
object
Obtain slots of a specimen without using at-mark
## S4 method for signature 'specimens' x$name
## S4 method for signature 'specimens' x$name
x |
specimens object |
name |
name of the slot. |
value at chosen slot in the site
object
Assign values to slots within a chronology object.
## S4 replacement method for signature 'chronology' x$name <- value
## S4 replacement method for signature 'chronology' x$name <- value
x |
A chronology object |
name |
The name of the chronology slot. |
value |
A value to be assigned to the chronology slot. |
reassigned chronology
object
Assign collunit field by numeric index
## S4 replacement method for signature 'collunit' x$name <- value
## S4 replacement method for signature 'collunit' x$name <- value
x |
The collunit object. |
name |
name of the slot. |
value |
The value to be used. |
assign a new value to a slot
Assign dataset field by numeric index
## S4 replacement method for signature 'dataset' x$name <- value
## S4 replacement method for signature 'dataset' x$name <- value
x |
The dataset object. |
name |
name of the slot. |
value |
The value to be used. |
Assign new dataset
by numeric index
Assign site field by numeric index
## S4 replacement method for signature 'site' x$name <- value
## S4 replacement method for signature 'site' x$name <- value
x |
The site object. |
name |
name of the slot |
value |
The value to be used. |
site
object with reassigned values
Assign specimen field by numeric index
## S4 replacement method for signature 'specimen' x$name <- value
## S4 replacement method for signature 'specimen' x$name <- value
x |
The specimen object. |
name |
name of the slot. |
value |
The value to be used. |
specimen
object with reassigned values
Add a new chronology to a collection unit.
add_chronology(object, x, y)
add_chronology(object, x, y)
object |
A collectionunit object |
x |
A chronology object |
y |
A |
chronology object defined by user,
Given a collunit, add a new chronology object to the unit
with both the chronology metadata and the age information (as y
)
## S4 method for signature 'collunit,chronology,data.frame' 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 Complex Workflows documentation online.
chronologies
with new added chronology
data.frame
Convert a publication author to a data.frame
## S4 method for signature 'authors' as.data.frame(x)
## S4 method for signature 'authors' as.data.frame(x)
x |
An author |
data.frame
with publications metadata
Convert all slots within each chronology within a chronologies object to a data.frame.
## S4 method for signature 'chronologies' as.data.frame(x)
## S4 method for signature 'chronologies' as.data.frame(x)
x |
chronologies object |
data.frame with chronologies metadata
Convert all slots within a chronology to a data.frame.
## S4 method for signature 'chronology' as.data.frame(x)
## S4 method for signature 'chronology' as.data.frame(x)
x |
chronology object |
data.frame
show as dataframe
## S4 method for signature 'collunit' as.data.frame(x)
## S4 method for signature 'collunit' as.data.frame(x)
x |
site object |
data.frame object with a collection units metadata
show as dataframe as prep to save as csv
## S4 method for signature 'collunits' as.data.frame(x)
## S4 method for signature 'collunits' as.data.frame(x)
x |
collunits object |
data.frame of multiple collection units metadata.
Transform a contacts object to a data.frame()
## S4 method for signature 'contact' as.data.frame(x)
## S4 method for signature 'contact' as.data.frame(x)
x |
A contact object. |
data.frame
object with contact metadata
Transform a contacts object to a data.frame()
## S4 method for signature 'contacts' as.data.frame(x)
## S4 method for signature 'contacts' as.data.frame(x)
x |
A contacts object. |
data.frame
object with multiple contacts
metadata
show as dataframe as prep to save as csv
## S4 method for signature 'dataset' as.data.frame(x)
## S4 method for signature 'dataset' as.data.frame(x)
x |
dataset object |
data.frame
with dataset
metadata
show as dataframe as prep to save as csv
## S4 method for signature 'datasets' as.data.frame(x)
## S4 method for signature 'datasets' as.data.frame(x)
x |
datasets object |
data.frame
with datasets
metadata
publication
to a data.frame
Convert a publication
to a data.frame
## S4 method for signature 'publication' as.data.frame(x)
## S4 method for signature 'publication' as.data.frame(x)
x |
A |
data.frame
with publications' metadata.
data.frame
Convert publications to a data.frame
## S4 method for signature 'publications' as.data.frame(x)
## S4 method for signature 'publications' as.data.frame(x)
x |
A |
data.frame
with publications' metadata.
show as dataframe as prep to save as csv
## S4 method for signature 'site' as.data.frame(x)
## S4 method for signature 'site' as.data.frame(x)
x |
site object |
data.frame
object with site metadata
shows object as data.frame
## S4 method for signature 'sites' as.data.frame(x)
## S4 method for signature 'sites' as.data.frame(x)
x |
sites object |
data.frame
object with sites metadata
show as data.frame
## S4 method for signature 'specimen' as.data.frame(x)
## S4 method for signature 'specimen' as.data.frame(x)
x |
specimen object |
data.frame
with specimen metadata
show as data.frame
## S4 method for signature 'specimens' as.data.frame(x)
## S4 method for signature 'specimens' as.data.frame(x)
x |
specimens object |
data.frame
with specimens metadata
show as dataframe as prep to save as csv
## S4 method for signature 'sites' as.list(x)
## S4 method for signature 'sites' as.list(x)
x |
sites object |
list
object with sites metadata
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) }
The S4 authors
are a set of individual author
objects that
are then associated with a single S4 publication
class.
object of class authors
{ 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)) }
{ 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)) }
A helper function to build a new chronology object from the Neotoma API response.
build_chron(x)
build_chron(x)
x |
A chronology element from the API JSON output. |
This function is an internal function called from
build_collunit()
to help support the translation between the JSON
representation of data in the API and the R implementation.
A single chronology
object.
Socorro Dominguez
Build a collection unit from the API response
build_collunits(x)
build_collunits(x)
x |
The structured JSON from a Neotoma API v2.0 response that returns a collection unit in any form. |
An simple collunit
object
Helper function to build a dataset from the API JSON response.
build_dataset(x)
build_dataset(x)
x |
a JSON dataset object passed from the Neotoma API. |
A simple dataset
object.
Socorro Dominguez
data.frame
from Neotoma API JSONHelper function to build a sample from the API input (list formatted) coming from the Neotoma API.
build_sample(x)
build_sample(x)
x |
sample list |
A simple sample
object
Socorro Dominguez [email protected]
site
from the Neotoma API response.Build a site
from the Neotoma API response.
build_sites(x)
build_sites(x)
x |
A list returned from the Neotoma API |
A simple site
object
A helper function to build a specimen object from a list returned by the Neotoma API call. The function is not exported, but called from the get_specimens() call.
build_specimen(x)
build_specimen(x)
x |
specimen list |
A simple specimen
object
c Method - Combine chronologies objects
## S4 method for signature 'chronologies' c(x, y)
## S4 method for signature 'chronologies' c(x, y)
x |
chronologies object 1 |
y |
chronologies object 2 |
concatenated chronologies
c Method - Combine collunits objects
## S4 method for signature 'collunits' c(x, y)
## S4 method for signature 'collunits' c(x, y)
x |
collunits object 1 |
y |
collunits object 2 |
concatenated collection units without duplicates
c Method - Combine contacts objects
## S4 method for signature 'contact' c(x, y)
## S4 method for signature 'contact' c(x, y)
x |
contacts object 1 |
y |
contacts object 2 |
contacts
concatenated object
c Method - Combine contacts objects
## S4 method for signature 'contacts' c(x, y)
## S4 method for signature 'contacts' c(x, y)
x |
contacts object 1 |
y |
contacts object 2 |
concatenated and clean objects
c Method - Combine datasets objects
## S4 method for signature 'datasets' c(x, y)
## S4 method for signature 'datasets' c(x, y)
x |
datasets object 1 |
y |
datasets object 2 |
concatenated datasets
object
c Method for NULL values
c Method for NULL values
## S4 method for signature 'missingOrNULL' c(x = "missingORNULL", y) ## S4 method for signature 'missingOrNULL' c(x = "missingORNULL", y)
## S4 method for signature 'missingOrNULL' c(x = "missingORNULL", y) ## S4 method for signature 'missingOrNULL' c(x = "missingORNULL", y)
x |
NULL object |
y |
sites/datasets object |
concatenated collunits
object
list
of concatenated items when the first object is NULL
Combine publication objects.
## S4 method for signature 'publications' c(x, y)
## S4 method for signature 'publications' c(x, y)
x |
A publications object. |
y |
A publications object |
concatenated publications
object
c Method - Combine sites objects
## S4 method for signature 'sites' c(x, y)
## S4 method for signature 'sites' c(x, y)
x |
sites object 1 |
y |
sites object 2 |
concatenated and cleaned sites
object
c Method - Combine specimens objects
## S4 method for signature 'specimens' c(x, y)
## S4 method for signature 'specimens' c(x, y)
x |
specimens object 1 |
y |
specimens object 2 |
concatenated specimens
object
Internal function to check passed arguments.
check_args(cl)
check_args(cl)
cl |
called arguments.
Arguments are going to be called by match_call inside:
|
A list with two components:
flag |
Returns a 0 if everything's fine, a 1 if there's a problem. |
message |
A list of error messages. |
Socorro Dominguez
Neotoma Project Website: https://www.neotomadb.org/
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, ...)
check_contacts(x, ...)
x |
contacts A |
... |
Additional parameters associated with the call. |
contacts object
Get contact information for Neotoma contributors
## S3 method for class 'contacts' check_contacts(x, similarity = 0.5, ...)
## S3 method for class 'contacts' check_contacts(x, similarity = 0.5, ...)
x |
contacts A |
similarity |
The similarity score between matched records (from 0 - 1). |
... |
Additional parameters associated with the call. |
contacts object
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
Obtain the chronology from a record or multiple records.
chronologies(x)
chronologies(x)
x |
sites object that contains chronologies |
chronologies object with all chronologies used.
The grouped class for chronologies from the Neotoma Paleoecology Database.
object of class chronologies
chronologies
from a collunit
object.Extract chronologies
from a collunit
object.
## S4 method for signature 'collunit' chronologies(x)
## S4 method for signature 'collunit' chronologies(x)
x |
A |
chronologies
from a collunit
object
chronologies
from a collunits
object.Extract chronologies
from a collunits
object.
## S4 method for signature 'collunits' chronologies(x)
## S4 method for signature 'collunits' chronologies(x)
x |
A |
chronologies
from a collunits
object
chronologies
from a site
object.Extract chronologies
from a site
object.
## S4 method for signature 'site' chronologies(x)
## S4 method for signature 'site' chronologies(x)
x |
A |
chronologies
from a site
object
chronologies
from a sites
object.Extract chronologies
from a sites
object.
## S4 method for signature 'sites' chronologies(x)
## S4 method for signature 'sites' chronologies(x)
x |
A |
chronologies
from a sites
object
The class for chronologies from the
Neotoma Paleoecology Database. A single collection unit may
have one or more chronology. These individual chronology
classes are then grouped into an S4 chronologies
class.
object of class chronology
The function, applied to a data object with a valid dataset, will return a properly formatted data citation for the record.
cite_data(x)
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 'site' cite_data(x)
## S4 method for signature 'site' cite_data(x)
x |
sites object |
data.frame
object with citation information.
ds <- get_datasets(1) cite_data(ds)
ds <- get_datasets(1) cite_data(ds)
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.
{ ds <- get_datasets(1) cite_data(ds) }
{ ds <- get_datasets(1) cite_data(ds) }
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 collunit
Extract collection units from a sites object
collunits(object)
collunits(object)
object |
A sites object |
collunits detail from a sites object
Holds Collection unit information
from the Neotoma Paleoecology Database.
@returns object of class collunits
collunits
from a site
object.Extract collunits
from a site
object.
## S4 method for signature 'site' collunits(object)
## S4 method for signature 'site' collunits(object)
object |
A |
collunits
from a site
object
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
The object that contains the contact information for an individual, along with associated metadata.
object of class contact
new("contact", familyname = "Goring", givennames = "Simon J.")
new("contact", familyname = "Goring", givennames = "Simon J.")
An unordered list of individual S4 contact
objects.
object of class contacts
{ # Create two contact objects and associate them within a contacts object. simon <- new("contact", familyname = "Goring", givennames = "Simon J.") socorro <- new("contact", familyname = "Dominguez", givennames = "Socorro") packagers <- new("contacts", contacts = list(simon, socorro)) packagers }
{ # Create two contact objects and associate them within a contacts object. simon <- new("contact", familyname = "Goring", givennames = "Simon J.") socorro <- new("contact", familyname = "Dominguez", givennames = "Socorro") packagers <- new("contacts", contacts = list(simon, socorro)) packagers }
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.
The standard object class for datasets from the Neotoma Paleoecology Database.
object of class dataset
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)
datasets(object)
object |
A sites object |
datasets object specific to the metadata contained in datasets
The grouped class for datasets from the Neotoma Paleoecology Database.
object of class datasets
datasets
from a collunit
object.Extract datasets
from a collunit
object.
## S4 method for signature 'collunit' datasets(object)
## S4 method for signature 'collunit' datasets(object)
object |
A |
datasets
from a collunit
object
datasets
from a collunits
object.Extract datasets
from a collunits
object.
## S4 method for signature 'collunits' datasets(object)
## S4 method for signature 'collunits' datasets(object)
object |
A |
datasets
from a collunits
object
datasets
from a site
object.Extract datasets
from a site
object.
## S4 method for signature 'site' datasets(object)
## S4 method for signature 'site' datasets(object)
object |
A |
datasets
from a site
object
datasets
from a sites
object.Extract datasets
from a sites
object.
## S4 method for signature 'sites' datasets(object)
## S4 method for signature 'sites' datasets(object)
object |
A |
datasets
from a sites
object
Obtain the DOI for publications or datasets.
doi(x)
doi(x)
x |
Object with DOIs associated to it. |
doi object with DOI information
Get a publication DOI.
## S4 method for signature 'publication' doi(x)
## S4 method for signature 'publication' doi(x)
x |
A |
DOI
from a publication
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 'site' doi(x)
## S4 method for signature 'site' doi(x)
x |
a Neotoma2 |
data.frame
object with DOIs information.
{ ds <- get_datasets(1) doi(ds) }
{ ds <- get_datasets(1) doi(ds) }
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.
{ ds <- get_datasets(1) doi(ds) }
{ ds <- get_datasets(1) doi(ds) }
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(x, ...)
filter(x, ...)
x |
A site, dataset or download. |
... |
arguments to filter by. |
filtered sites
object
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.
## S3 method for class 'sites' filter(x, ...)
## S3 method for class 'sites' filter(x, ...)
x |
A sites object. |
... |
arguments to filter by. |
filtered sites
object
# Download 100 sites, but only keep the sites that are close to sea level. some_sites <- get_sites(sitename = "Lake%", limit = 3) site_subset <- some_sites %>% filter(altitude < 100) # Download 100 sites, get all associated datasets, but keep only # sites/datasets that are of datasettype "pollen": sites <- get_sites(limit = 1) %>% get_datasets(all_data = TRUE) pollen_subset <- sites %>% filter(datasettype == "pollen")
# Download 100 sites, but only keep the sites that are close to sea level. some_sites <- get_sites(sitename = "Lake%", limit = 3) site_subset <- some_sites %>% filter(altitude < 100) # Download 100 sites, get all associated datasets, but keep only # sites/datasets that are of datasettype "pollen": sites <- get_sites(limit = 1) %>% get_datasets(all_data = TRUE) pollen_subset <- sites %>% filter(datasettype == "pollen")
Uses 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, ...)
get_contacts(x = NA, ...)
x |
integer A contact ID |
... |
( |
contacts
object
Uses the Neotoma API to search and access information about individuals who have contributed to the data in the Neotoma Paleoecology Database
## Default S3 method: get_contacts(x, ...)
## Default S3 method: get_contacts(x, ...)
x |
integer A contact ID |
... |
( |
contacts
object
Uses the Neotoma API to search and access information about individuals who have contributed to the data in the Neotoma Paleoecology Database
## S3 method for class 'numeric' get_contacts(x, ...)
## S3 method for class 'numeric' get_contacts(x, ...)
x |
integer A contact ID |
... |
( |
contacts
object
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, ...)
get_datasets(x = NA, ...)
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]
# To find all datasets with a min altitude of 12 and a max altitude of 25: sites_12to25 <- get_datasets(altmin=12, altmax=25) # 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]]]}' brazil_datasets <- get_datasets(loc = brazil[1], limit=2) # To obtain the dataset metadata: datasets(brazil_datasets) # There is insufficient metadata at this point to obtain information # about taxa present at the site. We must use get_downloads() to # obtain the full set of sample information: # This fails: taxa(brazil_datasets)
# To find all datasets with a min altitude of 12 and a max altitude of 25: sites_12to25 <- get_datasets(altmin=12, altmax=25) # 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]]]}' brazil_datasets <- get_datasets(loc = brazil[1], limit=2) # To obtain the dataset metadata: datasets(brazil_datasets) # There is insufficient metadata at this point to obtain information # about taxa present at the site. We must use get_downloads() to # obtain the full set of sample information: # This fails: taxa(brazil_datasets)
Get Dataset Default
## Default S3 method: get_datasets(x, ...)
## Default S3 method: get_datasets(x, ...)
x |
Use a single number to extract site information |
... |
accepted arguments, see details for more information. |
sites
object with full metadata up to the dataset
level
{ # To find all datasets with a min altitude of 12 and a max altitude of 25: sites_12to25 <- get_datasets(altmin=12, altmax=25, limit=2) # 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]]]}' brazil_datasets <- get_datasets(loc = brazil[1], limit=2) }
{ # To find all datasets with a min altitude of 12 and a max altitude of 25: sites_12to25 <- get_datasets(altmin=12, altmax=25, limit=2) # 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]]]}' brazil_datasets <- get_datasets(loc = brazil[1], limit=2) }
Get Dataset Numeric
## S3 method for class 'numeric' get_datasets(x, ...)
## S3 method for class 'numeric' get_datasets(x, ...)
x |
Use a single number to extract site information |
... |
Additional parameters to get_datasets |
sites
object with full metadata up to the dataset
level
allds <- get_datasets(1:3)
allds <- get_datasets(1:3)
site
object.Get Dataset from a site
object.
## S3 method for class 'site' get_datasets(x, ...)
## S3 method for class 'site' get_datasets(x, ...)
x |
An object of class |
... |
additional arguments accepted by |
sites
object with full metadata up to the dataset
level
random_sites <- get_sites(1) allds <- get_datasets(random_sites, limit=3)
random_sites <- get_sites(1) allds <- get_datasets(random_sites, limit=3)
sites
object.Get Dataset from a sites
object.
## S3 method for class 'sites' get_datasets(x, ...)
## S3 method for class 'sites' get_datasets(x, ...)
x |
An object of class |
... |
additional arguments accepted by |
sites
object with full metadata up to the dataset
level
random_sites <- get_sites(1) allds <- get_datasets(random_sites, limit=3)
random_sites <- get_sites(1) allds <- get_datasets(random_sites, limit=3)
Information for Fossil Datasets
get_downloads(x = NA, verbose = TRUE, ...)
get_downloads(x = NA, verbose = TRUE, ...)
x |
Use a single number to extract site information |
verbose |
Status bar of items being downloaded |
... |
accepted arguments: sites, datasets |
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]
# To find the downloads object of dataset 24: downloads24 <- get_downloads(24) # 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]]]}' brazil_datasets <- get_datasets(loc = brazil[1]) brazil_downloads <- get_downloads(brazil_datasets)
# To find the downloads object of dataset 24: downloads24 <- get_downloads(24) # 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]]]}' brazil_datasets <- get_datasets(loc = brazil[1]) brazil_downloads <- get_downloads(brazil_datasets)
get_downloads JSON
## S3 method for class 'character' get_downloads(x, verbose = TRUE, ...)
## S3 method for class 'character' get_downloads(x, verbose = TRUE, ...)
x |
sites object |
verbose |
Should text be printed during the download process? |
... |
arguments in ellipse form |
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.
get_downloads
## S3 method for class 'numeric' get_downloads(x, verbose = TRUE, ...)
## S3 method for class 'numeric' get_downloads(x, verbose = TRUE, ...)
x |
Use a single number to extract site information |
verbose |
Should text be printed during the download process? |
... |
arguments in ellipse form |
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.
get_downloads sites
## S3 method for class 'sites' get_downloads(x, verbose = TRUE, ...)
## S3 method for class 'sites' get_downloads(x, verbose = TRUE, ...)
x |
sites object |
verbose |
Should text be printed during the download process? |
... |
arguments in ellipse form |
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.
Open up the Neotoma manual homepage.
get_manual()
get_manual()
NULL side effect for opening browser with the manual
Simon Goring [email protected]
{ # 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() } }
{ # 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() } }
Uses the Neotoma API to search and access information about publications associated with data in the Neotoma Paleoecology Database
get_publications(x = NA, ...)
get_publications(x = NA, ...)
x |
integer A contact ID |
... |
|
publications
object
# How old are the papers in Neotoma that include the term "mammut"? mammoth_papers <- get_publications(search="mammut") %>% as.data.frame() hist(as.numeric(mammoth_papers$year))
# How old are the papers in Neotoma that include the term "mammut"? mammoth_papers <- get_publications(search="mammut") %>% as.data.frame() hist(as.numeric(mammoth_papers$year))
Get publication information from Neotoma
## Default S3 method: get_publications(...)
## Default S3 method: get_publications(...)
... |
|
publications
object
# How old are the papers in Neotoma that include the term "mammut"? mammoth_papers <- get_publications(search="mammut") %>% as.data.frame() hist(as.numeric(mammoth_papers$year))
# How old are the papers in Neotoma that include the term "mammut"? mammoth_papers <- get_publications(search="mammut") %>% as.data.frame() hist(as.numeric(mammoth_papers$year))
Get publications using their unique identifier.
## S3 method for class 'numeric' get_publications(x, ...)
## S3 method for class 'numeric' get_publications(x, ...)
x |
integer A contact ID |
... |
|
publications
object
{ # We want the paper identified in Neotoma as 666: get_publications(666) }
{ # We want the paper identified in Neotoma as 666: get_publications(666) }
This works for records without publicationids. We assume that data with publicationids is correct.
## S3 method for class 'publication' get_publications(x, ...)
## S3 method for class 'publication' get_publications(x, ...)
x |
integer A publication |
... |
|
updated publication
object
# Take a publication object and purposely degrade the metadata: 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 <- as.character(NA) 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]]
# Take a publication object and purposely degrade the metadata: 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 <- as.character(NA) 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]]
Update metadata for a set of publication objects.
## S3 method for class 'publications' get_publications(x, ...)
## S3 method for class 'publications' get_publications(x, ...)
x |
integer A publication |
... |
|
publications
object
# Take a publication object and purposely degrade the metadata: bad_pub <- get_publications(c(666, 667, 668)) # Note this only changes the reported year, not the citation string. bad_pub[[1]]@year <- "1923" bad_pub[[1]]@publicationid <- as.character(NA) updated_pubs <- get_publications(bad_pub) # Only the first publication object has any matches. It's the only one # that is missing its publicaitonid. attr(updated_pubs[[1]], "matches") attr(updated_pubs[[2]], "matches") # we see the proper citation in the record: updated_pubs[[1]] <- attr(updated_pubs[[1]], "matches")[[1]]
# Take a publication object and purposely degrade the metadata: bad_pub <- get_publications(c(666, 667, 668)) # Note this only changes the reported year, not the citation string. bad_pub[[1]]@year <- "1923" bad_pub[[1]]@publicationid <- as.character(NA) updated_pubs <- get_publications(bad_pub) # Only the first publication object has any matches. It's the only one # that is missing its publicaitonid. attr(updated_pubs[[1]], "matches") attr(updated_pubs[[2]], "matches") # we see the proper citation in the record: updated_pubs[[1]] <- attr(updated_pubs[[1]], "matches")[[1]]
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, ...)
get_sites(x = NA, ...)
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]
## Find all sites with a min altitude of 12m and a max altitude of 25m ## By default returns only 25 sites (default limit is 25): sites_12to25 <- get_sites(altmin=12, altmax=25) ## Return all sites, using a minimum altitude of 2500m (returns >500 sites): sites_2500 <- get_sites(altmin=2500, all_data = TRUE) ## To find all sites that contain the string "Alex%" alex_sites <- get_sites(sitename="Alex%") ## To find sites in Brazil (again with default 25 records) 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]) # Finding all sites with Liliaceae pollen in 1000 year bins: lilysites <- c() for (i in seq(0, 10000, by = 1000)) { lily <- get_sites(taxa=c("Liliaceae"), ageyoung = i - 500, ageold = i + 500, all_data = TRUE) lilysites <- c(lilysites, length(lily)) } plot(x = seq(0, 10000, by = 1000), y = lilysites, type = 'b')
## Find all sites with a min altitude of 12m and a max altitude of 25m ## By default returns only 25 sites (default limit is 25): sites_12to25 <- get_sites(altmin=12, altmax=25) ## Return all sites, using a minimum altitude of 2500m (returns >500 sites): sites_2500 <- get_sites(altmin=2500, all_data = TRUE) ## To find all sites that contain the string "Alex%" alex_sites <- get_sites(sitename="Alex%") ## To find sites in Brazil (again with default 25 records) 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]) # Finding all sites with Liliaceae pollen in 1000 year bins: lilysites <- c() for (i in seq(0, 10000, by = 1000)) { lily <- get_sites(taxa=c("Liliaceae"), ageyoung = i - 500, ageold = i + 500, all_data = TRUE) lilysites <- c(lilysites, length(lily)) } plot(x = seq(0, 10000, by = 1000), y = lilysites, type = 'b')
get_sites
## Default S3 method: get_sites(...)
## Default S3 method: get_sites(...)
... |
One of a set of possible query parameters discussed in details. |
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.
collunits
limited information on collunits
Socorro Dominguez [email protected]
Get Site Information for Fossil Sites
## S3 method for class 'numeric' get_sites(x, ...)
## S3 method for class 'numeric' get_sites(x, ...)
x |
The numeric site ID from Neotoma |
... |
accepted arguments if numeric all_data |
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.
collunits
limited information on collunits
{ ## Find all sites by numeric siteid: sites <- get_sites(seq(1,3)) }
{ ## Find all sites by numeric siteid: sites <- get_sites(seq(1,3)) }
Get Site Information for Fossil Sites from a Set of Sites
## S3 method for class 'sites' get_sites(x, ...)
## S3 method for class 'sites' get_sites(x, ...)
x |
The numeric site ID from Neotoma |
... |
accepted arguments if numeric all_data |
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.
collunits
limited information on collunits
## Find all sites using a set of prior sites: char_sites <- get_sites(taxa = "charcoal") pollen_coloc <- get_sites(char_sites, datasettype = "pollen") char_coloc <- char_sites %>% filter(siteid %in% getids(pollen_coloc)$siteid) pol_char <- c(pollen_coloc, char_coloc)
## Find all sites using a set of prior sites: char_sites <- get_sites(taxa = "charcoal") pollen_coloc <- get_sites(char_sites, datasettype = "pollen") char_coloc <- char_sites %>% filter(siteid %in% getids(pollen_coloc)$siteid) pol_char <- c(pollen_coloc, char_coloc)
Information for Specimens
get_specimens(x = NA, ...)
get_specimens(x = NA, ...)
x |
Use a single specimenid |
... |
Additional terms passed to get_specimens, most common datasetid |
The function returns a specimens list
Socorro Dominguez [email protected]
# To find specimen with ID 7: my_specimens <- get_specimens(7) # To find specimens in datasetid 41610 my_specimens2 <- get_specimens(datasetid = 41610)
# To find specimen with ID 7: my_specimens <- get_specimens(7) # To find specimens in datasetid 41610 my_specimens2 <- get_specimens(datasetid = 41610)
Get Specimen datasetid
## Default S3 method: get_specimens(...)
## Default S3 method: get_specimens(...)
... |
Pass argument datasetid and the corresponding datasetid |
The function returns a specimens list
{ # To find specimens in datasetid 41610 my_specimens <- get_specimens(datasetid = 41610) }
{ # To find specimens in datasetid 41610 my_specimens <- get_specimens(datasetid = 41610) }
Get Specimen Numeric
## S3 method for class 'numeric' get_specimens(x, ...)
## S3 method for class 'numeric' get_specimens(x, ...)
x |
Use a single number to extract site information |
... |
Additional terms passed to get_specimens. |
The function returns a specimens list
{ ## To find specimen with ID 7 my_specimens <- get_specimens(7) }
{ ## To find specimen with ID 7 my_specimens <- get_specimens(7) }
Get Specimen Sites
## S3 method for class 'sites' get_specimens(x, ...)
## S3 method for class 'sites' get_specimens(x, ...)
x |
Use a single number to extract site information |
... |
Other possible parameters such as datasetid |
The function returns a specimens list
# To find specimen with ID 7: my_site <- get_sites(13296) # To find specimens in `my_site` my_specimens <- get_specimens(my_site)
# To find specimen with ID 7: my_site <- get_sites(13296) # To find specimens in `my_site` my_specimens <- get_specimens(my_site)
Returns a count of sites, datasets, publications and other objects added to Neotoma during the requested time period.
get_stats(start, end)
get_stats(start, end)
start |
The starting month (from present == 0) for which to generate the summary. |
end |
The ending month (from present == 0) for which to generate the summary. |
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]
last_month <- get_stats(start = 0, end = 1)
last_month <- get_stats(start = 0, end = 1)
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
{ # Returns only the first 25 specimen records. someSpec <- get_table('specimens') }
{ # Returns only the first 25 specimen records. someSpec <- get_table('specimens') }
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)
getids(x, order = TRUE)
x |
A Neotoma2 |
order |
sort items by siteid, collunitid, datasetid |
data.frame
containing siteid
, datasetid
, and collunitid
From a collectionunit
object, return the
collectionunit and dataset ids.
## S3 method for class 'collunit' getids(x, order = TRUE)
## S3 method for class 'collunit' getids(x, order = TRUE)
x |
A Neotoma2 |
order |
sort items by siteid, collunitid, datasetid |
data.frame
containing siteid
, datasetid
, and collunitid
{ marion <- get_sites(sitename = "Marion Lake") collunitids <- getids(collunits(marion)[[1]]) }
{ marion <- get_sites(sitename = "Marion Lake") collunitids <- getids(collunits(marion)[[1]]) }
From a set of collectionunit
objects, return the
collectionunit and dataset ids.
## S3 method for class 'collunits' getids(x, order = TRUE)
## S3 method for class 'collunits' getids(x, order = TRUE)
x |
A Neotoma2 |
order |
sort items by siteid, collunitid, datasetid |
data.frame
containing siteid
, datasetid
, and collunitid
{ marion <- get_sites(sitename = "Marion Lake") collunitids <- getids(collunits(marion)) }
{ marion <- get_sites(sitename = "Marion Lake") collunitids <- getids(collunits(marion)) }
Get object IDs from a site object.
## S3 method for class 'site' getids(x, order = TRUE)
## S3 method for class 'site' getids(x, order = TRUE)
x |
A Neotoma2 |
order |
sort items by siteid, collunitid, datasetid |
data.frame
containing siteid
, datasetid
, and collunitid
Get object IDs from sites
## S3 method for class 'sites' getids(x, order = TRUE)
## S3 method for class 'sites' getids(x, order = TRUE)
x |
A Neotoma2 |
order |
sort items by siteid, collunitid, datasetid |
data.frame
containing siteid
, datasetid
, and collunitid
Length Method chronologies
## S4 method for signature 'chronologies' length(x)
## S4 method for signature 'chronologies' length(x)
x |
chronologies object |
integer describing length
Length Method collunits
## S4 method for signature 'collunits' length(x)
## S4 method for signature 'collunits' length(x)
x |
collunits object |
length of a collunits
object
Length Method datasets
## S4 method for signature 'datasets' length(x)
## S4 method for signature 'datasets' length(x)
x |
datasets object |
int
that showcases the length of a datasets
object
Get the number of publications in a publications object.
## S4 method for signature 'publications' length(x)
## S4 method for signature 'publications' length(x)
x |
A publications object. |
int
of the length of the publications
object
Length Method samples
## S4 method for signature 'samples' length(x)
## S4 method for signature 'samples' length(x)
x |
samples object |
int
representing the length of samples object
Length Method Sites
## S4 method for signature 'sites' length(x)
## S4 method for signature 'sites' length(x)
x |
sites object |
int
with the length of sites object
Length Method specimens
## S4 method for signature 'specimens' length(x)
## S4 method for signature 'specimens' length(x)
x |
specimens object |
int
with length of specimens
object
c Method - Combine objects, including NULL
c Method - Combine objects, including NULL
Get all names for named elements within a collunit
object.
## S4 method for signature 'collunit' names(x)
## S4 method for signature 'collunit' names(x)
x |
A collection unit object. |
NULL. Shows the names of the slots
Get names of contacts slots
## S4 method for signature 'contact' names(x)
## S4 method for signature 'contact' names(x)
x |
A contact object. |
names of slots
Get all names for named elements within a dataset
object.
## S4 method for signature 'dataset' names(x)
## S4 method for signature 'dataset' names(x)
x |
A dataset object. |
list
with all names of dataset
slots
Get slot names for a publication object.
## S4 method for signature 'publication' names(x)
## S4 method for signature 'publication' names(x)
x |
A |
string
with publication
slots' names
Get slot names for a publication object.
## S4 method for signature 'publications' names(x)
## S4 method for signature 'publications' names(x)
x |
A |
string
with publications
slots' names
Get all names for named elements within a site
object.
## S4 method for signature 'site' names(x)
## S4 method for signature 'site' names(x)
x |
A site object. |
names of the slots of a site
object
Get all names for named elements within a specimen
object.
## S4 method for signature 'specimen' names(x)
## S4 method for signature 'specimen' names(x)
x |
A specimen object. |
names of the slots of a site
object
Take a set of arguments from the Neotoma2 package and produce
the appropriate URL to the Neotoma v2.0 API.
This is an internal function used by parseURL()
.
newURL(baseurl, args, ...)
newURL(baseurl, args, ...)
baseurl |
The base URL for the Neotoma API |
args |
The set of query arguments to be passed to the API |
... |
Any additional arguments to be passed to the function. |
A properly formatted URL.
An internal helper function to parse the API result into a site object.
parse_site(result)
parse_site(result)
result |
A JSON object from the API. |
A Neotoma2 site object.
An internal helper function used to connect to the Neotoma API in a standard manner, and to provide basic validation of any response.
parseURL(x, use = "neotoma", all_data = FALSE, ...)
parseURL(x, use = "neotoma", all_data = FALSE, ...)
x |
The HTTP/S path for the particular API call. |
use |
Uses the Neotoma server by default ("neotoma"), but supports either the development API server ("dev") or a local server ("local"). |
all_data |
If TRUE return all possible API calls |
... |
Any query parameters passed from the calling function. |
list
with cleaned and parsed data from HTTP request
Socorro Dominguez [email protected]
Simon Goring [email protected]
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.
{ test_connection <- pingNeotoma("neotoma") }
{ test_connection <- pingNeotoma("neotoma") }
Plot site coordinates using a basic plot.
## S4 method for signature 'sites' plot(x, y, ...)
## S4 method for signature 'sites' plot(x, y, ...)
x |
sites object |
y |
ANY |
... |
Additional parameters associated with the call. |
plot
object with site coordinates.
Plot site coordinates using a basic plot.
## S4 method for signature 'sites,ANY' plot(x, y, ...)
## S4 method for signature 'sites,ANY' plot(x, y, ...)
x |
sites object |
y |
ANY |
... |
Additional parameters associated with the call. |
plot
object with site coordinates.
Plot sites on a leaflet map
plotLeaflet(object)
plotLeaflet(object)
object |
Sites object to plot |
leaflet map with site markers
Socorro Dominguez [email protected]
Plot a site on a leaflet map
## S4 method for signature 'site' plotLeaflet(object)
## S4 method for signature 'site' plotLeaflet(object)
object |
Site object to plot |
leaflet
map
modernSites <- get_sites(keyword = "Modern") plotLeaflet(modernSites[[1]])
modernSites <- get_sites(keyword = "Modern") plotLeaflet(modernSites[[1]])
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
# Note that by default the limit for queries is 25 records: modernSites <- get_sites(keyword = "Modern") plotLeaflet(modernSites)
# Note that by default the limit for queries is 25 records: modernSites <- get_sites(keyword = "Modern") plotLeaflet(modernSites)
A publication is liked to an individual Neotoma dataset object
They are grouped using an S4 publications
class.
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) }
An S4 class for multi-publication information from the Neotoma Paleoecology Database. This S4 class allows a single dataset to have one or more publication classes associated with it.
object of class publications
The grouped class for repositories from the Neotoma Paleoecology Database.
object of class repositories
The standard object class for repository from the Neotoma Paleoecology Database.
object of class repository
The standard object class for samples from the Neotoma Paleoecology Database.
object of class sample
Obtain samples from a record or multiple records.
samples(x)
samples(x)
x |
sites object |
data.frame with record information at sample level
The grouped class for samples from the Neotoma Paleoecology Database.
object of class samples
Obtain elements from collunit
## S4 method for signature 'collunit' samples(x)
## S4 method for signature 'collunit' samples(x)
x |
collunit object |
data.frame
with sample records
Obtain elements from collunits
## S4 method for signature 'collunits' samples(x)
## S4 method for signature 'collunits' samples(x)
x |
collunits object |
data.frame
with sample records
Obtain elements on the samples level
## S4 method for signature 'site' samples(x)
## S4 method for signature 'site' samples(x)
x |
site object |
data.frame
with sample records
marion <- get_sites(sitename = "Marion Lake") %>% get_datasets() %>% filter(datasettype == "pollen") %>% get_downloads() pollen <- samples(marion)
marion <- get_sites(sitename = "Marion Lake") %>% get_datasets() %>% filter(datasettype == "pollen") %>% get_downloads() pollen <- samples(marion)
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
{ dw <- get_downloads(1) pollen <- samples(dw) }
{ dw <- get_downloads(1) pollen <- samples(dw) }
Select the best match for an object.
selectMatch(x, n)
selectMatch(x, n)
x |
object |
n |
n elements that are a best match |
attr Select the match between a local record and a Neotoma match
Select the best match (between a local record and a Neotoma match)
## S4 method for signature 'publication,logical' selectMatch(x, n)
## S4 method for signature 'publication,logical' selectMatch(x, n)
x |
A |
n |
The match number (in the case an NA is returned). |
the best match to the selected publication.
Select the best match (between a local record and a Neotoma match)
## S4 method for signature 'publication,numeric' selectMatch(x, n)
## S4 method for signature 'publication,numeric' selectMatch(x, n)
x |
A |
n |
The match number. |
the best match to the selected publication.
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
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 = new("datasets"), chronologies = new("chronologies"), defaultchronology = NA_integer_ )
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 = new("datasets"), chronologies = new("chronologies"), defaultchronology = NA_integer_ )
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 |
collunit
object
{ # 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_, 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_, 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.
|
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_, database = NA_character_, doi = NA, datasettype = NA_character_, age_range_old = NA_integer_, age_range_young = NA_integer_, notes = NA_character_, pi_list = NA, samples = new("samples") )
set_dataset( x = NA, datasetid = NA_integer_, database = NA_character_, doi = NA, datasettype = NA_character_, age_range_old = NA_integer_, age_range_young = NA_integer_, notes = NA_character_, pi_list = NA, samples = new("samples") )
x |
object to be set as dataset, |
datasetid |
dataset identifier |
database |
dataset where the dataset came from |
doi |
DOI |
datasettype |
type the dataset belongs to |
age_range_old |
age range old |
age_range_young |
age range young |
notes |
notes |
pi_list |
pi list |
samples |
taxa objects |
dataset
object
{ # 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_publications( 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_publications( 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 )
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
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
{ # 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)
# 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")
# 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")
set Site Information for Fossil Sites
set_site( x = NA, siteid = NA_integer_, sitename = NA_character_, geography = st_as_sf(st_sfc()), altitude = NA_integer_, geopolitical = list(), area = NA_integer_, notes = NA_character_, description = NA_character_, collunits = new("collunits") )
set_site( x = NA, siteid = NA_integer_, sitename = NA_character_, geography = st_as_sf(st_sfc()), altitude = NA_integer_, geopolitical = list(), area = NA_integer_, notes = NA_character_, description = NA_character_, collunits = new("collunits") )
x |
Object to be set as a site |
siteid |
The unique site id for a site. If this site is new to Neotoma then leave the ID as NA (the default). |
sitename |
Actual site name as a character string. |
geography |
An |
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 for personal analysis. The new object will not be uploaded to the database. |
collunits |
Collection units in the site |
site
object
{ # 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) }
Show the collection unit information
## S4 method for signature 'collunit' show(object)
## S4 method for signature 'collunit' show(object)
object |
collunit object |
null used for side effects. Printing a data.frame
Show the collection unit information
## S4 method for signature 'collunits' show(object)
## S4 method for signature 'collunits' show(object)
object |
collunits object |
null used for side effects. Printing a data.frame
Show contact object
Show a contact object
## S4 method for signature 'contact' show(object) ## S4 method for signature 'contact' show(object)
## S4 method for signature 'contact' show(object) ## S4 method for signature 'contact' show(object)
object |
a |
null - side effect for printing contact object
Null - prints a data.frame
Show a contacts object.
## S4 method for signature 'contacts' show(object)
## S4 method for signature 'contacts' show(object)
object |
A contacts object. |
null - side effect for printing contacts object
Show Dataset Method
## S4 method for signature 'dataset' show(object)
## S4 method for signature 'dataset' show(object)
object |
dataset object |
null - side effect, prints a data.frame
with dataset
metadata
Show Datasets object as a dataframe
## S4 method for signature 'datasets' show(object)
## S4 method for signature 'datasets' show(object)
object |
datasets object |
null - side effect, prints a data.frame
with datasets
metadata
Print publications to screen.
## S4 method for signature 'publication' show(object)
## S4 method for signature 'publication' show(object)
object |
A |
NULL - side effect function of printing a data.frame
Show the contents of a publication object.
## S4 method for signature 'publications' show(object)
## S4 method for signature 'publications' show(object)
object |
A |
NULL - side effect function of printing a data.frame
Convert a Neotoma package site object into a data.frame() returning the siteid, sitename, latitude, longitude and altitude of the site.
## S4 method for signature 'site' show(object)
## S4 method for signature 'site' show(object)
object |
site object |
NULL - side effect for printing a data.frame
object
Return a set of site objects as a single data.frame().
## S4 method for signature 'sites' show(object)
## S4 method for signature 'sites' show(object)
object |
sites object |
NULL - side effect for printing a data.frame
object
Show Specimen Method
## S4 method for signature 'specimen' show(object)
## S4 method for signature 'specimen' show(object)
object |
specimen object |
NULL - side effect for printing a data.frame
object
Show Specimens object as a dataframe
## S4 method for signature 'specimens' show(object)
## S4 method for signature 'specimens' show(object)
object |
specimens object |
NULL - side effect for printing a data.frame
object
Show matches for objects.
showMatch(x)
showMatch(x)
x |
object to show matches for |
data.frame that marks if a site
exists in another sites
object
Show matched publication objects.
## S4 method for signature 'publication' showMatch(x)
## S4 method for signature 'publication' showMatch(x)
x |
A |
NULL printed matches with other publications
The standard object class for sites from the Neotoma Paleoecology Database.
object of class site
The standard object class for multi-sites
from the Neotoma Paleoecology Database.from
@returns object of class sites
The standard object class for specimen from the Neotoma Paleoecology Database.
object of class specimen
Obtain specimens from a record or multiple records.
specimens(x)
specimens(x)
x |
sites object |
data.frame with record information regarding specimens
The grouped class for specimens from the Neotoma Paleoecology Database.
object of class specimens
Obtain specimen elements from a collunit
## S4 method for signature 'collunit' specimens(x)
## S4 method for signature 'collunit' specimens(x)
x |
|
data.frame
with specimens summary table
Obtain specimen elements from collunits
## S4 method for signature 'collunits' specimens(x)
## S4 method for signature 'collunits' specimens(x)
x |
|
data.frame
with specimens summary table
Obtain elements on the specimens level
## S4 method for signature 'site' specimens(x)
## S4 method for signature 'site' specimens(x)
x |
site object |
data.frame
with specimens summary table
Information table for Specimens
## S4 method for signature 'sites' specimens(x)
## S4 method for signature 'sites' specimens(x)
x |
Use a |
data.frame
with specimens summary table
Socorro Dominguez [email protected]
# To return a specimens table do: my_specimens <- get_specimens(7) my_tbl <- specimens(my_specimens)
# To return a specimens table do: my_specimens <- get_specimens(7) my_tbl <- specimens(my_specimens)
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)
taxa(object)
object |
Sites object to extract taxa table from |
data.frame with taxa records
Extract taxonomic data from a set of sites.
## S4 method for signature 'collunit' taxa(object)
## S4 method for signature 'collunit' taxa(object)
object |
A |
A data.frame
reporting the taxa/data objects, units,
elements and other features within a set of records.
Extract taxonomic data from a set of sites.
## S4 method for signature 'collunits' taxa(object)
## S4 method for signature 'collunits' taxa(object)
object |
A |
A data.frame
reporting the taxa/data objects, units,
elements and other features within a set of records.
Extract taxonomic data from a single site.
## S4 method for signature 'site' taxa(object)
## S4 method for signature 'site' taxa(object)
object |
A |
A data.frame
reporting the taxa/data objects, units,
elements and other features within a set of records.
somesites <- get_sites(datasettype = "pollen", limit = 3) %>% get_downloads() diatomtaxa <- taxa(somesites[[1]])
somesites <- get_sites(datasettype = "pollen", limit = 3) %>% get_downloads() diatomtaxa <- taxa(somesites[[1]])
From a sites object,
## 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.
somesites <- get_sites(datasettype = "diatom", limit = 3) %>% get_downloads() diatomtaxa <- taxa(somesites) common_taxa <- diatomtaxa %>% dplyr::filter(sites == 3)
somesites <- get_sites(datasettype = "diatom", limit = 3) %>% get_downloads() diatomtaxa <- taxa(somesites) common_taxa <- diatomtaxa %>% dplyr::filter(sites == 3)
Export toJSON
toJSON(x)
toJSON(x)
x |
Sites object to extract taxa table from |
JSON translation of sites
object to JSON
Socorro Dominguez [email protected]
Convert a Neotoma2 sites
object into a standardized JSON file for API management.
## S4 method for signature 'sites' toJSON(x = NA)
## S4 method for signature 'sites' toJSON(x = NA)
x |
sites R object to be converted |
The function returns a character string in JSON format
Socorro Dominguez [email protected]
{ # To find all sites that contain the string "Alexander%" alex.sites <- get_sites(sitename="Alexander%") # Convert the object to json toJSON(alex.sites) }
{ # To find all sites that contain the string "Alexander%" alex.sites <- get_sites(sitename="Alexander%") # Convert the object to json toJSON(alex.sites) }
Obtain a wide table with information regarding of samples grouped by variablename and depth/age.
toWide( x, variablenames = c(), ecologicalgroups = c(), elementtypes = c(), unit = c(), groupby = "age", operation = "prop" )
toWide( x, variablenames = c(), ecologicalgroups = c(), elementtypes = c(), unit = c(), 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
fourcorners <- '{"type": "Polygon", "coordinates": [[ [-109.36060497194846, 37.69552879956651], [-107.813845732192, 37.69552879956651], [-107.813845732192, 36.80303716260222], [-109.36060497194846, 36.80303716260222], [-109.36060497194846, 37.69552879956651] ]]}' # Download all vertebrate localities within a bounding box. fc_sites <- neotoma2::get_sites(loc = fourcorners[1]) fc_ds <- neotoma2::get_datasets(fc_sites) %>% neotoma2::filter(datasettype=="vertebrate fauna") fc_dl <- neotoma2::get_downloads(fc_ds) fc_dl1 <- fc_dl[[1]] fc_smp <- samples(fc_dl1) toWide(fc_smp, ecologicalgroups=c('AVES', 'RODE'), elementtypes='bone/tooth', unit='present/absent')
fourcorners <- '{"type": "Polygon", "coordinates": [[ [-109.36060497194846, 37.69552879956651], [-107.813845732192, 37.69552879956651], [-107.813845732192, 36.80303716260222], [-109.36060497194846, 36.80303716260222], [-109.36060497194846, 37.69552879956651] ]]}' # Download all vertebrate localities within a bounding box. fc_sites <- neotoma2::get_sites(loc = fourcorners[1]) fc_ds <- neotoma2::get_datasets(fc_sites) %>% neotoma2::filter(datasettype=="vertebrate fauna") fc_dl <- neotoma2::get_downloads(fc_ds) fc_dl1 <- fc_dl[[1]] fc_smp <- samples(fc_dl1) toWide(fc_smp, ecologicalgroups=c('AVES', 'RODE'), elementtypes='bone/tooth', unit='present/absent')
write CSV
## S4 method for signature 'chronologies' write.csv(x, ...)
## S4 method for signature 'chronologies' write.csv(x, ...)
x |
chronologies object |
... |
Additional parameters associated with the call. |
null, called for side effects
write CSV
## S4 method for signature 'collunits' write.csv(x, ...)
## S4 method for signature 'collunits' write.csv(x, ...)
x |
collunits object |
... |
Additional parameters associated with the call. |
null side effect for saving a CSV file.
write CSV
## S4 method for signature 'datasets' write.csv(x, ...)
## S4 method for signature 'datasets' write.csv(x, ...)
x |
datasets object |
... |
Additional parameters associated with the call. |
null -side effect for printing a CSV file
write CSV
## S4 method for signature 'sites' write.csv(x, ...)
## S4 method for signature 'sites' write.csv(x, ...)
x |
A sites object |
... |
Other options to pass to |
NULL side effect from saving a csv file
write CSV
## S4 method for signature 'specimens' write.csv(x, ...)
## S4 method for signature 'specimens' write.csv(x, ...)
x |
specimens object |
... |
Additional parameters associated with the call. |
NULL - side effect of saving CSV file