Learn R Programming

neotoma2 R Package

The neotoma2 R package represents a set of breaking changes with the original neotoma R package. The neotoma package was deprecated following end-of-life for the Neotoma Windows Server in 2020 and the migration of the Neotoma backend infrastructure to a PostgreSQL database and JavaScript API.

The neotoma2 package is built on the new Neotoma API and is intended as a starting point for a fully interactive experience with the Neotoma Paleoecology Database, to support both data access and data input through R.

Contributors

This project is an open project, and contributions are welcome from any individual. All contributors to this project are bound by a code of conduct. Please review and follow this code of conduct as part of your contribution.

Tips for Contributing

Issues and bug reports are always welcome. Code clean-up, and feature additions can be done either through pull requests to project forks or project branches.

Please direct development questions to Simon Goring by email: goring@wisc.edu.

All products of the Neotoma Paleoecology Database are licensed under an MIT License unless otherwise noted.

How to use this repository

All R functions for the package should be written in the R folder. Any documentation should be added to .R files using roxygen2 notation. Because we are using roxygen2 for documentation in this package, all edits to documentation should take place in the associated functions .R file. The files in the man folder should not be manually changed.

Class definitions and new methods should be added to the files 01_classDefinitions.R and 02_genericDefinitions.R respectively, to ensure they are properly loaded during the package build process.

Development Workflow Overview

The neotoma2 package is built for R. Build tools include elements from the usethis, devtools and testthat R packages, and build and compilation occurs within (and outside) the RStudio IDE environment.

Package use requires the use of the devtools::install_github() function, to pull this working repository into a user's environment:

devtools::install_github('NeotomaDB/neotoma2', build_vignettes = TRUE)

To see the rendered vignette, you can also visit the following site: https://open.neotomadb.org/neotoma2/inst/doc/neotoma2-package.html

The expectation for this repository is that all commits to the prod branch will support a clean package build. This is supported through GitHub Actions in the .github folder of the repository.

Analysis Workflow Overview

There is considerable information in the vignettes for the package, which can be accessed directly.

Report of Sites Statistics

In order to see the total available sites that can be queried by this package, use the function:

neotoma2::get_stats(start=0, end=1)

System Requirements

This project is built with R > v4.0. The packages needed for proper package use are detailed in the DESCRIPTION file for this repository.

Data Requirements

The neotoma2 R package pulls data from the Neotoma Paleoecology Database. Neotoma maintains a permissive data use policy. Within the data use policy there is a statement on co-authorship which reads:

Normal ethics apply to co-authorship of scientific publications. Paleoecological datasets are labor-intensive and complex: they take years to generate and always have additional attributes and metadata not captured in Neotoma. Neotoma data quality also relies on expert curation by data stewards, each associated with one or more Constituent Databases. Users of data stored in Neotoma’s Constituent Databases should consider inviting the original data contributor, or Constituent Database steward(s), to be a co-author(s) of any resultant publications if that contributor’s data are a major portion of the dataset analyzed, or if a data contributor or steward makes a significant contribution to the analysis of the data or to the interpretation of results. For large-scale studies using many Neotoma records, contacting all contributors or stewards or making them co-authors will not be practical, possible, or reasonable. Under no circumstance should authorship be attributed to data contributors or stewards, individually or collectively, without their explicit consent.

Metrics

This project is to be evaluated using the following metrics:

  • Maintenance Github 1.0.4 release, DONE July 23, 2024
  • Updated production Branch with CRAN changes, May 24, 2024.
  • Maintenance Github 1.0.3 release, DONE February 28, 2024
  • Published JOSS paper, DONE 28 November, 2023
  • Submitted paper to JOSS DONE 03 May, 2023
  • Completion CRAN 1.0.0 release DONE April 23, 2023
  • Completion of core functionality for data access DONE Feb 10, 2022
  • Completion of core functionality for data presentation DONE
  • Completion of clear vignettes for major data types or Constituent Databases represented within the Neotoma Database.

Copy Link

Version

Install

install.packages('neotoma2')

Monthly Downloads

270

Version

1.0.5

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Dominguez Vidana Socorro

Last Published

August 20th, 2024

Functions in neotoma2 (1.0.5)

c,contacts-method

c Method - Combine contacts objects
$,chronology-method

Extract
build_chron

build_chron
as.data.frame,specimens-method

as.data.frame specimens
as.list,sites-method

as.list sites
c,sites-method

c Method - Combine sites objects
c,publications-method

Combine publication objects.
$,sites-method

$ for sites
$,specimen-method

$
$<-,chronology-method

Replace part of an object
$<-,collunit-method

Assign collunit field by numeric index
c,collunits-method

c Method - Combine collunits objects
c,chronologies-method

c Method - Combine chronologies objects
build_dataset

Build a dataset object from a JSON list representation.
build_sample

Build a samples data.frame from Neotoma API JSON
check_args

check_args
$<-,site-method

Assign site field by numeric index
$<-,dataset-method

Assign dataset field by numeric index
$,specimens-method

$ for specimens
chronologies

Obtain the chronology from a record or multiple records.
c,datasets-method

c Method - Combine datasets objects
c,missingOrNULL-method

c Method for NULL values
build_collunits

Build a collection unit from the API response
$,datasets-method

$ for datasets
$,publication-method

Extract an element from a publication
$<-,specimen-method

Assign specimen field by numeric index
contact-class

An S4 class for Neotoma contacts
$,collunit-method

$
datasets,site-method

Extract datasets from a site object.
$,samples-method

$ for samples
chronologies,collunit-method

Extract chronologies from a collunit object.
$,sample-method

$
datasets,sites-method

Extract datasets from a sites object.
contacts-class

An S4 class for multi-contact information from the Neotoma Paleoecology Database.
chronologies,collunits-method

Extract chronologies from a collunits object.
collunit-class

S4 class for collection units information.
doi

Obtain the DOI for publications or datasets.
c,specimens-method

c Method - Combine specimens objects
collunits

Extract collection units from a sites object
datasets,collunits-method

Extract datasets from a collunits object.
cite_data

Generate a data citation from a Neotoma2 object.
filter

Apply a filter for Neotoma sites objects.
chronology-class

S4 class for chronologies information
$,site-method

$
datasets,collunit-method

Extract datasets from a collunit object.
collunits,sites-method

Extract collunits from a sites object.
get_datasets.numeric

Get Dataset Numeric
get_datasets.site

Get Dataset from a site object.
get_manual

get_manual
as.data.frame,publications-method

Convert publications to a data.frame
get_downloads.sites

get_downloads sites
get_contacts.numeric

Get contact information for Neotoma contributors
get_publications.numeric

Get publications using their unique identifier.
get_publications.publication

Update information for a publications object.
get_contacts.default

Get contact information for Neotoma contributors
get_datasets.sites

Get Dataset from a sites object.
get_specimens.sites

Get Specimen Sites
cite_data,sites-method

Obtain data citations from multiple records.
collunits,site-method

Extract collunits from a site object.
collunits-class

An S4 class for Neotoma Collection Units
cite_data,site-method

Obtain data citations from a single record.
get_specimens.numeric

Get Specimen Numeric
get_specimens.default

Get Specimen datasetid
$,chronologies-method

Extract
$,contacts-method

Extract or Replace Parts of an Object
chroncontrols,site-method

Recover information about the chron controls for a collectionunit.
$,dataset-method

$
getids

Get object IDs
get_stats

get_stats
get_table

Get table record from Neotoma
datasets-class

S4 class for datasets information
chronologies,site-method

Extract chronologies from a site object.
get_downloads

get_downloads
dataset-class

S4 class for dataset information
chronologies,sites-method

Extract chronologies from a sites object.
chroncontrols,sites-method

Recover information about the chron controls for a collectionunit.
plotLeaflet,site-method

plotLeaflet
length,samples-method

Length Method samples
length,sites-method

Length Method Sites
get_datasets

get_datasets
get_sites.numeric

Get Site Information for Fossil Sites
get_datasets.default

Get Dataset Default
datasets

Extract datasets from a sites object.
get_sites.default

get_sites
length,publications-method

Get the number of publications in a publications object.
names,publications-method

Get slot names for a publication object.
length,datasets-method

Length Method datasets
length,collunits-method

Length Method collunits
parsebody

parse_body
length,chronologies-method

Length Method chronologies
as.data.frame,site-method

as.data.frame site
doi,publication-method

Get a publication DOI.
get_publications

Get publication information for Neotoma records
plotLeaflet,sites-method

plotLeaflet
repository-class

S4 class for repository information
pingNeotoma

pingNeotoma
plotLeaflet

plotLeaflet
get_publications.default

Get publication information from Neotoma
get_sites

get_sites
get_publications.publications

Update metadata for a set of publication objects.
names,contact-method

Get names of contacts slots
names,collunit-method

Get slot names
%>%

Pipe operator
plot,sites-method

Plot site coordinates using a basic plot.
publications-class

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.
names,site-method

Get slot names
build_sites

Build a site from the Neotoma API response.
repositories-class

S4 class for repositories information
build_specimen

Build a specimen objects.
samples,sites-method

samples
publication-class

An S4 class for a single Neotoma publication.
getids.collunit

Get object IDs from a single collectionunit.
specimens

Obtain specimens from a record or multiple records.
set_site

set Site Information for Fossil Sites
samples

Obtain samples from a record or multiple records.
[[,contacts,numeric-method

Extract or Replace Parts of an Object
specimens,sites-method

specimens
show,collunit-method

Show the collection unit information
set_collunit

set Site Information for Fossil Sites
set_contact

Set contact information for a new record.
[[<-,specimens,ANY,ANY,ANY-method

Insert specimen
[[,datasets,numeric-method

Slicer
taxa,site-method

Extract taxonomic data from a single site.
[<-,collunit,character,ANY,ANY-method

Assign collunit field by numeric index
sample-class

S4 class for dataset information
taxa,sites-method

Extract taxonomic data from a set of sites.
show,dataset-method

Show Dataset Method
show,contacts-method

Show a contacts object.
show,publication-method

Print publications to screen.
show,datasets-method

Show Datasets object as a dataframe
selectMatch

Select the best match for an object.
$,collunits-method

$ for collunits
selectMatch,publication,numeric-method

Select the best match (between a local record and a Neotoma match)
samples,collunit-method

samples
selectMatch,publication,logical-method

Select the best match (between a local record and a Neotoma match)
set_sample

set Sample Information
samples-class

S4 class for the set of samples
chroncontrols

chroncontrols
check_contacts

Check contact information for a record against Neotoma contributors
check_contacts.contacts

Get contact information for Neotoma contributors
$,contact-method

Extract or Replace Parts of an Object
[,datasets,numeric-method

Get or remove datasets by numeric index
[,collunits,numeric-method

Get or remove sites by numeric index
[<-,dataset,character,ANY,ANY-method

Assign dataset field by numeric index
[<-,collunit,numeric,ANY,ANY-method

Assign collunit field by numeric index
taxa,collunit-method

Extract taxonomic data from a set of sites.
taxa,collunits-method

Extract taxonomic data from a set of sites.
set_server

Set Neotoma API Source or Server
specimens-class

S4 class for specimens information
show,site-method

Show a site object as a dataframe
show,publications-method

Show the contents of a publication object.
taxa

taxa
getids.collunits

Get object IDs from collectionunits.
names,dataset-method

Get slot names
write.csv,specimens-method

write CSV
[[,publications,numeric-method

Obtain one of the elements within a publication list.
[[<-,datasets,ANY,ANY,ANY-method

Insert dataset
specimens,collunit-method

specimens
[[,samples,numeric-method

Slicer
[[<-,collunits,ANY,ANY,ANY-method

Insert collunit
chronologies-class

S4 class for chronologies information
set_default

Set the default chronology within a collectionunit.
set_chronology

set chronology information for a new record.
set_publications

Create a new publication (or publication set)
show,sites-method

Show sites objects as a dataframe
parseURL

parseURL
[,site,character-method

Get site field by character index
names,publication-method

Get slot names for a publication object.
parse_site

parse_site
show,specimen-method

Show Specimen Method
show,specimens-method

Show Specimens object as a dataframe
toJSON,sites-method

toJSON
showMatch,publication-method

Show matched publication objects.
[[<-,sites,ANY,ANY,ANY-method

Insert site
[,site,numeric-method

Get site field by numeric index
[[<-,publications,ANY,ANY,ANY-method

Assign value to an element in a publication list.
doi,site-method

Obtain dataset DOIs from records.
coordinates,sites-method

Return the latitude and longitude of sites
coordinates

Obtain coordinates from a sites object.
doi,sites-method

Obtain dataset DOIs from records.
filter.sites

Apply a filter for Neotoma sites objects.
get_contacts

Get contact information for Neotoma contributors
[<-,specimen,character,ANY,ANY-method

Assign specimen field by numeric index
get_sites.sites

Get Site Information for Fossil Sites from a Set of Sites
getids.sites

Get object IDs from sites
getids.site

Get object IDs from a site object.
specimens,collunits-method

specimens
write.csv,chronologies-method

write CSV
[<-,site,numeric,ANY,ANY-method

Assign site field by numeric index
get_specimens

get_specimens
get_downloads.numeric

get_downloads
get_downloads.character

get_downloads JSON
write.csv,collunits-method

write CSV
length,specimens-method

Length Method specimens
[[,collunits,numeric-method

Slicer
specimens,site-method

specimens
missingOrNULL-class

c Method - Combine objects, including NULL
[[,sites,numeric-method

Slicer
[[,specimens,numeric-method

Slicer
[[,chronologies,numeric-method

Extract
names,specimen-method

Get slot names
[<-,specimen,numeric,ANY,ANY-method

Assign specimen field by numeric index
summary,sites-method

Summary of objects within a sites object.
newURL

Format API call to Neotoma from call arguments
toWide

toWide
toJSON

toJSON
samples,collunits-method

Get samples from a collectionunit or set of collection units:
samples,site-method

samples
set_dataset

set Site Information for Fossil Sites
set_default,chronologies-method

Change the default age model for a record.
showMatch

Show matches for objects.
sites-class

An S4 class for multi-site information
show,collunits-method

Show the collection unit information
show,contact-method

Show contact object
site-class

An S4 class for site information
[,specimens,numeric-method

Get or remove specimens by numeric index
write.csv,sites-method

write CSV
[,sites,numeric-method

Get or remove sites by numeric index
[<-,site,character,ANY,ANY-method

Assign site field by numeric index
[<-,dataset,numeric,ANY,ANY-method

Assign dataset field by numeric index
specimen-class

S4 class for specimen information
write.csv,datasets-method

write CSV
as.data.frame,contacts-method

Transform a contacts object to a data.frame()
as.data.frame,dataset-method

as.data.frame dataset
add_chronology,collunit,chronology,data.frame-method

Add a new chronology into an existing collectionunit.
as.data.frame,authors-method

Convert a publication author to a data.frame
as.data.frame,chronologies-method

as.data.frame chronologies
as.data.frame,collunit-method

as.data.frame site
add_chronology

Add a new chronology to a collection unit.
as.data.frame,collunits-method

as.data.frame collunits
as.data.frame,contact-method

Transform a contacts object to a data.frame()
as.data.frame,chronology-method

Create a data.frame from a chronology object.
as.data.frame,sites-method

as.data.frame sites
c,contact-method

c Method - Combine contacts objects
as.data.frame,datasets-method

as.data.frame datasets
as.data.frame,publication-method

Convert a publication to a data.frame
as.data.frame,specimen-method

as.data.frame specimen
authors-class

An S4 class for a set of Neotoma author objects.
author-class

An S4 class for the authors of a Neotoma publication.