Title: Fetch Geologic Data from the 'Macrostrat' Platform
Description: Work with the 'Macrostrat' (https://macrostrat.org/) Web Service (v.2, https://macrostrat.org/api/v2) to fetch geological data relevant to the spatial and temporal distribution of sedimentary, igneous, and metamorphic rocks as well as data extracted from them.
Version: 1.0.0
License: GPL (≥ 3)
Language: en-US
Encoding: UTF-8
RoxygenNote: 7.3.2
Depends: R (≥ 4.0)
Imports: curl, geojsonsf, httr, jsonlite, sf
Suggests: covr, cowplot, deeptime, devtools, ggplot2, ggrepel, ggspatial, knitr, rmarkdown, rnaturalearth, rnaturalearthhires, rphylopic, palaeoverse, testthat (≥ 3.0.0), units
Additional_repositories: https://ropensci.r-universe.dev
VignetteBuilder: knitr
Config/testthat/edition: 3
URL: https://rmacrostrat.palaeoverse.org, https://palaeoverse.org, https://macrostrat.org, https://github.com/UW-Macrostrat/macrostrat/issues
BugReports: https://github.com/palaeoverse/rmacrostrat/issues
NeedsCompilation: no
Packaged: 2024-10-18 08:21:37 UTC; lewis
Author: Lewis A. Jones ORCID iD [aut, cre, cph], William Gearty ORCID iD [aut], Christopher D. Dean ORCID iD [aut], Bethany Allen ORCID iD [aut]
Maintainer: Lewis A. Jones <LewisA.Jones@outlook.com>
Repository: CRAN
Date/Publication: 2024-10-18 12:40:02 UTC

rmacrostrat: Fetch Geologic Data from the 'Macrostrat' Platform

Description

logo

Work with the 'Macrostrat' (https://macrostrat.org/) Web Service (v.2, https://macrostrat.org/api/v2) to fetch geological data relevant to the spatial and temporal distribution of sedimentary, igneous, and metamorphic rocks as well as data extracted from them.

Author(s)

Maintainer: Lewis A. Jones LewisA.Jones@outlook.com (ORCID) [copyright holder]

Authors:

See Also

Useful links:


Fetch data from Macrostrat

Description

This function fetches data from Macrostrat via the Application Programming Interface (API). This is the core function for handling user requests.

Usage

GET_macrostrat(endpoint, query = list(), format = "json", output = "df")

Arguments

endpoint

character. The API endpoint to retrieve data from Macrostrat.

query

character. The API query to retrieve data from Macrostrat.

format

character. The format that data should be downloaded in. Either: "csv", "json" (the default), or "geojson".

output

character. If format is "json", what format should the output be in? Valid options are "list" (the default) or "df" (data.frame). If "df" is chosen, all metadata will be lost.

Value

A data.frame (if format is "csv" or "json" and output is "df"), a list (if format is "json" and output is "list"), or sf object (if format is "geojson").


Get API version

Description

Get API version

Usage

api_version()

Retrieve a complete set of definitions

Description

A function to retrieve all definitions and/or metadata for a given definition set. Caution: some datasets are large and may take time to retrieve.

Usage

catalog(type = NULL)

Arguments

type

character. The name of a definition set to retrieve. See Definitions section below for options.

Value

A data.frame containing an exhaustive list of the definitions and/or metadata retrievable for the given definition set. The variables in the data.frame will match those described in the documentation for that definition set.

Definitions

Developer(s)

Bethany Allen & Lewis A. Jones

Reviewer(s)

Lewis A. Jones

Examples


  # Get mineral definitions
  ex1 <- catalog(type = "minerals")
  # Get grain size definitions
  ex2 <- catalog(type = "grain_sizes")


Check if arguments are valid (internal)

Description

This function checks whether user arguments are valid in terms of being an available argument or of the correct class.

Usage

check_arguments(x, ref)

Arguments

x

list. The user-query list to compare against ref.

ref

list. The reference list to compare x against.

Value

Error messages or TRUE if all arguments are valid.


Define Macrostrat columns

Description

A function to retrieve the definitions for Macrostrat columns. By default, all definitions are returned.

Usage

def_columns(
  column_id = NULL,
  column_group_id = NULL,
  column_name = NULL,
  project_id = NULL,
  status = NULL
)

Arguments

column_id

integer. The unique identification number(s) of the desired column(s) to return a definition for.

column_group_id

integer. The unique identification number(s) of the desired column group(s) to return a definition for.

column_name

character. The name of the desired column to return a definition for.

project_id

integer. The unique identification number(s) of the desired Macrostrat project(s) to return a definition for.

status

character. The status of the column to return a definition for. Either "active", "in process", or "obsolete".

Value

A data.frame containing the following columns:

Developer(s)

William Gearty

Reviewer(s)

Christopher D. Dean

See Also

Macrostrat data entities: get_age_model(), get_columns(), get_sections(), get_units()

Examples


# Return all column definitions
ex1 <- def_columns()
# Return subsets of column definitions
ex2 <- def_columns(column_group_id = 17)
ex3 <- def_columns(column_id = c(22,24))
ex4 <- def_columns(column_name = "Eastern Kentucky")


Define objects associated with eODP

Description

Obtain metadata for variables associated with the Extending Ocean Drilling Pursuits (eODP) project. By default, data for all drilling sites are returned.

Usage

def_drilling_sites(program = NULL, exp = NULL, site = NULL, sf = FALSE)

Arguments

program

character. The name of a drilling program (i.e., "DSDP", "ODP", or "IODP") to return a definition for.

exp

character. The unique identification number(s) of drilling expedition(s) to return a definition for (formerly known as 'leg(s)').

site

character. The unique identification number(s) of drilling site(s) to return a definition for.

sf

logical. Should the results be returned as an sf object? Defaults to FALSE.

Value

A data.frame object containing, for each retrieved core:

If sf is TRUE, an sf object is returned instead, with a "geometry" column that contains the spatial data instead of the lat/lng columns.

Developer(s)

Bethany Allen

Reviewer(s)

Christopher D. Dean

References

Sessa JA, Fraass AJ, LeVay LJ, Jamson KM, and Peters SE. (2023). The Extending Ocean Drilling Pursuits (eODP) Project: Synthesizing Scientific Ocean Drilling Data. Geochemistry, Geophysics, Geosystems, 24 (3) e2022GC010655. doi:10.1029/2022GC010655.

See Also

External data: def_measurements(), get_eodp(), get_fossils(), get_measurements()

Examples


# Return all core information for a specific site
core_info <- def_drilling_sites(site = "U1547")


Define economic resources

Description

A function to retrieve the definitions for one or more economic resources in the Macrostrat database. By default, all economic definitions are returned.

Usage

def_econs(econ = NULL, econ_type = NULL, econ_class = NULL, econ_id = NULL)

Arguments

econ

character. The name of the economic resource (e.g., "gas reservoir") to return a definition for.

econ_type

character. The type of economic resource (e.g., "hydrocarbon") to return a definition for.

econ_class

character. The class of economic resource (e.g., "energy") to return a definition for.

econ_id

integer. The unique identification number(s) of the economic resource(s) to return a definition for.

Value

A data.frame containing the following columns:

Developer(s)

Bethany Allen

Reviewer(s)

William Gearty

See Also

Geologic features and attributes: def_environments(), def_grain_sizes(), def_lithologies(), def_lithology_att(), def_measurements(), def_minerals(), def_structures()

Examples


# Return all economic resource definitions
econ_inf <- def_econs()
# Return only definitions for hydrocarbon resources
econ_inf <- def_econs(econ_type = "hydrocarbon")


Define environments

Description

A function to retrieve the definitions for one or more environments in the Macrostrat database. By default, all environment definitions are returned.

Usage

def_environments(
  environ = NULL,
  environ_type = NULL,
  environ_class = NULL,
  environ_id = NULL
)

Arguments

environ

character. The name of a specific environment (e.g., "reef") to return a definition for.

environ_type

character. The name of a type of environment (e.g., "carbonate") to return a definition for.

environ_class

character. The name of a class of environment (e.g., "marine") to return a definition for.

environ_id

integer. The unique identification number of the desired environment to return a definition for.

Value

A data.frame containing the following columns:

Developer(s)

Christopher D. Dean

Reviewer(s)

Lewis A. Jones

See Also

Geologic features and attributes: def_econs(), def_grain_sizes(), def_lithologies(), def_lithology_att(), def_measurements(), def_minerals(), def_structures()

Examples


# Return all environment definitions
ex1 <- def_environments()
# Return subsets of environment definitions
ex2 <- def_environments(environ = "reef")
ex3 <- def_environments(environ_type = "carbonate")
ex4 <- def_environments(environ_class = "marine")


Define grain sizes

Description

A function to return grain size definitions from the Macrostrat Database based on user-specified arguments. If no arguments are specified, all definitions are returned.

Usage

def_grain_sizes(
  grain_name = NULL,
  grain_group = NULL,
  soil_group = NULL,
  grain_id = NULL,
  grain_symbol = NULL,
  grain_classification = NULL
)

Arguments

grain_name

character. The name of the specific grain (e.g., "Coarse Gravel") to return a definition for.

grain_group

character. The name of the group the grain belongs to (e.g., "Gravel") to return a definition for.

soil_group

character. The name of the family of soils the grain belongs to (e.g., "Coarse Soil") to return a definition for.

grain_id

integer. The unique identification number(s) of the desired grain definitions(s) to return a definition for.

grain_symbol

character. The abbreviation of the desired grain definition(s) (e.g., "CGr") to return a definition for.

grain_classification

character. The classification scheme the given grain belongs to (e.g., "Wentworth") to return a definition for.

Value

A data.frame containing the following columns:

Developer(s)

Lewis A. Jones

Reviewer(s)

William Gearty

See Also

Geologic features and attributes: def_econs(), def_environments(), def_lithologies(), def_lithology_att(), def_measurements(), def_minerals(), def_structures()

Examples


 # Return all definitions
 ex1 <- def_grain_sizes()
 # Return grain sizes by group
 ex2 <- def_grain_sizes(grain_group = "Gravel")


Define Macrostrat time intervals

Description

A function to retrieve Macrostrat time interval definitions matching a user-specific search criteria. If no arguments are specified (the default), all time interval definitions are returned.

Usage

def_intervals(
  timescale = NULL,
  interval_name = NULL,
  interval_id = NULL,
  age = NULL,
  age_top = NULL,
  age_bottom = NULL,
  rule = NULL,
  true_colors = NULL
)

Arguments

timescale

character. The name of the desired timescale to return a definition for (e.g., "international epochs").

interval_name

character. The name of the desired interval to return a definition for.

interval_id

integer. The identification number(s) of the desired time interval to return a definition for.

age

numeric. Age in millions of years before present to return an interval definition for. All intervals overlapping with this age will be returned.

age_top

numeric. The minimum age for which interval definitions should be returned, in millions of years before present. If specified, age_bottom must also be specified, and this must be younger than age_bottom.

age_bottom

numeric. The maximum age for which interval definitions should be returned, in millions of years before present. If specified, age_top must also be specified, and this must be older than age_top.

rule

character. How should interval definitions be returned for the given age_top and age_bottom? Use "contains" to return all intervals that fall entirely within age_top and age_bottom. Use "exact" to return any intervals with both boundaries equal to age_top and age_bottom. Use "loose" (the default) to return all intervals touching the range of age_top and age_bottom. If age_top and age_bottom are not provided, this argument is ignored.

true_colors

logical. Should the original international time scale colors be returned? Defaults to TRUE.

Value

A data.frame containing the following columns:

Developer(s)

Lewis A. Jones

Reviewer(s)

William Gearty

See Also

Timescales and time intervals: def_timescales()

Examples


# Return all intervals
ex1 <- def_intervals()
# Return all specific timescale intervals
ex2 <- def_intervals(timescale = "international ages")
# Return for specific age
ex3 <- def_intervals(timescale = "international ages", age = 70)


Define lithologies

Description

A function to retrieve the definitions of one or more lithologies in the Macrostrat database. If no arguments are specified (the default), all lithology definitions are returned.

Usage

def_lithologies(
  lithology = NULL,
  lithology_group = NULL,
  lithology_class = NULL,
  lithology_type = NULL,
  lithology_id = NULL
)

Arguments

lithology

character. The name of the desired lithology (e.g., "limestone") to return a definition for.

lithology_group

character. The name of the desired lithological group (e.g., "unconsolidated") to return a definition for.

lithology_class

character. The name of the desired lithological class (e.g., "sedimentary") to return a definition for.

lithology_type

character. The name of the desired lithological type (e.g., "siliciclastic") to return a definition for.

lithology_id

integer. The unique identification number(s) of one or more lithologies to return a definition for.

Value

A data.frame containing the following columns:

Developer(s)

William Gearty

Reviewer(s)

Bethany Allen

See Also

Geologic features and attributes: def_econs(), def_environments(), def_grain_sizes(), def_lithology_att(), def_measurements(), def_minerals(), def_structures()

Examples


# return all lithology definitions
ex1 <- def_lithologies()
# return a definition for sandstone
ex2 <- def_lithologies(lithology = "sandstone")
# return definitions for lithologies of a specific type
ex3 <- def_lithologies(lithology_type = "sedimentary")
# return definitions for lithologies using their unique ID numbers
ex4 <- def_lithologies(lithology_id = c(1,5))


Define lithology attributes

Description

A function to retrieve the definitions for one or more lithology attributes in the Macrostrat database. By default, all lithology attribute definitions are returned.

Usage

def_lithology_att(
  lithology_att = NULL,
  att_type = NULL,
  lithology_att_id = NULL
)

Arguments

lithology_att

character. The name of the lithology attribute (e.g., "cross-bedded") to return a definition for.

att_type

character. The type of lithology attribute (e.g., "sed structure") to return a definition for.

lithology_att_id

integer. The unique identification number(s) of lithology attribute(s) to return a definition for.

Value

A data.frame containing the following columns:

Developer(s)

Bethany Allen

Reviewer(s)

Christopher D. Dean

See Also

Geologic features and attributes: def_econs(), def_environments(), def_grain_sizes(), def_lithologies(), def_measurements(), def_minerals(), def_structures()

Examples


# Return all lithology attribute definitions
ex1 <- def_lithology_att()
# Return subsets of lithology attribute definitions
ex2 <- def_lithology_att(att_type = "sed structure")


Define measurements

Description

A function to retrieve the definitions of different measurements that are included in the Macrostrat database. By default, all definitions are returned.

Usage

def_measurements(
  measure_id = NULL,
  measurement_type = NULL,
  measurement_class = NULL
)

Arguments

measure_id

integer. The unique identification number(s) of the desired measurement(s) to return a definition for.

measurement_type

character. Filter the returned definitions to those of one or more named type(s) of measurement (e.g., "geochronological"). This is a less inclusive grouping than measurement_class.

measurement_class

character. Filter the returned definitions to those of one or more named class(es) of measurement (e.g., "geochemical"). This is a more inclusive grouping than measurement_type.

Value

A data.frame containing the following columns:

Developer(s)

William Gearty

Reviewer(s)

Christopher D. Dean

See Also

External data: def_drilling_sites(), get_eodp(), get_fossils(), get_measurements()

Geologic features and attributes: def_econs(), def_environments(), def_grain_sizes(), def_lithologies(), def_lithology_att(), def_minerals(), def_structures()

Examples


# Return all definitions
ex1 <- def_measurements()
# Return subsets of definitions
ex2 <- def_measurements(measure_id = c(1, 2, 4))
ex3 <- def_measurements(measurement_class = "geochemical")


Define minerals

Description

A function to retrieve mineral definitions from the Macrostrat database based on user-specified arguments. If no arguments are provided, all definitions are returned.

Usage

def_minerals(mineral = NULL, mineral_type = NULL, element = NULL)

Arguments

mineral

character. The name of a mineral (e.g., "calcite") to return a definition for.

mineral_type

character. The type of mineral (e.g., "feldspar") to return a definition for.

element

character. The chemical element abbreviation of a mineral (e.g., "CaCO3") to return a definition for. Note: abbreviations are case sensitive.

Value

A data.frame containing the following columns:

Developer(s)

Lewis A. Jones

Reviewer(s)

Bethany Allen

See Also

Geologic features and attributes: def_econs(), def_environments(), def_grain_sizes(), def_lithologies(), def_lithology_att(), def_measurements(), def_structures()

Examples


  # Get all mineral definitions
  ex1 <- def_minerals()
  # Get mineral definitions by type
  ex2 <- def_minerals(mineral_type = "element")


Define tectonic plates

Description

A function to retrieve tectonic plate definitions for a user-specified plate identification number, as defined by the Wright et al. (2013) Global Plate Model. If no arguments are supplied, all plates are returned.

Usage

def_plates(plate_id = NULL)

Arguments

plate_id

integer. The unique identification number(s) of the desired plate(s) to return a definition for. If NULL (default), all plates are returned.

Value

A data.frame containing the plate_id of the tectonic plate and the name of the tectonic plate as defined by Wright et al. (2013).

Developer(s)

Lewis A. Jones

Reviewer(s)

Christopher D. Dean

References

Wright, N., Zahirovic, S., Müller, R.D., Seton, M. (2013). Towards community-driven paleogeographic reconstructions: integrating open-access paleogeographic and paleobiology data with plate tectonics. Biogeosciences, 10, 1529–1541. doi:10.5194/bg-10-1529-2013.

See Also

Paleogeography: get_paleogeography()

Examples


 # Get all tectonic plates
 ex1 <- def_plates()
 # Get name of tectonic plate by ID
 ex2 <- def_plates(plate_id = 604)


Retrieve metadata for Macrostrat projects

Description

A function to obtain information concerning the different Macrostrat projects. If no arguments are specified (default), data for all projects are returned.

Usage

def_projects(project_id = NULL)

Arguments

project_id

integer. The unique identification number(s) of the desired project(s) to return a definition for.

Value

A data.frame containing:

Developer(s)

Bethany Allen

Reviewer(s)

Lewis A. Jones

See Also

Macrostrat database metadata: def_references(), def_sources(), get_stats()

Examples


 ex1 <- def_projects()
 ex2 <- def_projects(project_id = 4)


Define references

Description

A function to retrieve the definitions for one or more published scientific references in the Macrostrat database. By default, all reference definitions are returned.

Usage

def_references(ref_id = NULL)

Arguments

ref_id

integer. The unique identification number(s) of the desired reference(s) to return a definition for. If NULL (default), all references are returned.

Value

A data.frame containing the following columns:

Developer(s)

William Gearty

Reviewer(s)

Bethany Allen

See Also

Macrostrat database metadata: def_projects(), def_sources(), get_stats()

Examples


# Return all references
ex1 <- def_references()
# Return a subset of references
ex2 <- def_references(ref_id = c(1, 2, 3))


Retrieve geologic map source definitions

Description

A function to retrieve the definitions for one or more geologic map sources in the Macrostrat database. By default, all source definitions are returned.

Usage

def_sources(
  source_id = NULL,
  lat = NULL,
  lng = NULL,
  shape = NULL,
  buffer = NULL,
  scale = NULL,
  sf = TRUE
)

Arguments

source_id

integer. The unique identification number(s) of the desired source(s) to return a definition for.

lat

numeric. A valid latitude in decimal degrees to return a source definition for. Must also supply lng.

lng

numeric. A valid longitude in decimal degrees to return a source definition for. Must also supply lat.

shape

character. A valid well-known text (WKT) representation of geometry, such as "POINT(30 10)" or "POLYGON((30 10, 40 40, 20 40, 10 20))", to return a source definition for.

buffer

integer. The geographic buffer (in meters) that should be applied to the specified shape.

scale

character. The desired Burwell scale, either: "tiny" (global), "small" (continental), "medium" (regional), or "large" (local).

sf

logical. Should the results be returned as an sf object? Defaults to TRUE. If FALSE, a data.frame is returned.

Value

A data.frame containing the following columns:

If sf is TRUE (the default), an sf object is returned instead, with the same columns plus a "geometry" column that contains the spatial data.

Developer(s)

William Gearty

Reviewer(s)

Lewis A. Jones

See Also

Geologic maps: get_map_legends(), get_map_outcrop(), get_map_points()

Macrostrat database metadata: def_projects(), def_references(), get_stats()

Examples


# Get all sources
ex1 <- def_sources()
# Get subset of sources
ex2 <- def_sources(source_id = c(1,2,4))
ex3 <- def_sources(lat = 43.03, lng = -89.4, scale = "large")
# Use WKT representation
library(sf)
line <- st_linestring(x = matrix(c(-122.3438, 37,-89.3527, 43.0582),
                                 byrow = TRUE, ncol = 2))
ex4 <- def_sources(shape = st_as_text(line), buffer = 100)


Define stratigraphic name concepts

Description

A function to retrieve the definitions for stratigraphic name concepts. By default, all stratigraphic name concept definitions are returned.

Usage

def_strat_name_concepts(strat_concept_name = NULL, strat_concept_id = NULL)

Arguments

strat_concept_name

character. The name(s) of the desired stratigraphic name concept(s) to return a definition for (e.g., "Hell Creek").

strat_concept_id

integer. The unique identification number(s) of the desired stratigraphic name concept(s) to return a definition for.

Details

Stratigraphic name concepts consist of grouped strat_names which represent the same geologic entity. This may be due to stratigraphic names appearing in multiple reference maps or at multiple lithostratigraphic ranks.

Value

A data.frame containing the following columns:

Developer(s)

Christopher D. Dean

Reviewer(s)

William Gearty

See Also

Stratigraphic names: def_strat_names()

Examples


# Return a stratigraphic name concept based on a string
ex1 <- def_strat_name_concepts(strat_concept_name = "Dakota")
# Return a stratigraphic name concept based on an ID
ex1 <- def_strat_name_concepts(strat_concept_id = 8212)


Define stratigraphic names

Description

A function to retrieve the definitions for one or more stratigraphic names in the Macrostrat database. By default, all stratigraphic name definitions are returned.

Usage

def_strat_names(
  strat_name = NULL,
  interval_name = NULL,
  rank = NULL,
  concept_id = NULL,
  ref_id = NULL,
  strat_name_id = NULL,
  rule = NULL
)

Arguments

strat_name

character. The name(s) of the desired stratigraphic unit(s) to return a definition for.

interval_name

character. The chronostratigraphic interval name (e.g., "Campanian") for which to return stratigraphic name definitions. This returns strat_names with an age declared in Macrostrat, whose age has any temporal overlap with the desired interval.

rank

character. The formal stratigraphic rank abbreviation of the desired name(s) (i.e., "SGp", "Gp", "SubGp", "Fm", "Mbr", or "Bed") to return a definition for.

concept_id

integer. The unique identification number(s) of the stratigraphic concept(s) (grouped strat_names which represent the same entity) to return a definition for.

ref_id

character. The unique identification number(s) of the desired reference(s). Only stratigraphic names linked to the specified ref_id will be returned.

strat_name_id

integer. The unique identification number(s) of the desired stratigraphic name to return a definition for.

rule

character. The hierarchical rule for returning stratigraphic name definitions (either "all" or "down"). The "all" option will return the entire stratigraphic name hierarchy (parents and children of all levels) that the requested name(s) belongs to. The "down" option will return any direct children of the requested stratigraphic name(s). Can only be used with strat_name_id.

Value

A data.frame containing the following columns:

Developer(s)

Christopher D. Dean

Reviewer(s)

Bethany Allen

See Also

Stratigraphic names: def_strat_name_concepts()

Examples


# Return a sample of stratigraphic names
ex1 <- def_strat_names()
# Return all stratigraphic names associated with a particular stratigraphic
# name
ex2 <- def_strat_names(strat_name = "Hell Creek")
# Return all stratigraphic names that intersect with a chosen time interval
ex3 <- def_strat_names(interval_name = "Campanian")


Define geological structure

Description

A function to retrieve definitions for various geological structures within the Macrostrat database.

Usage

def_structures(
  structure = NULL,
  structure_class = NULL,
  structure_type = NULL,
  structure_id = NULL
)

Arguments

structure

character. The name of a geological structure (e.g., "syncline") to return a definition for.

structure_class

character. The name of the geological structure class (e.g., "sedimentology") to return a definition for.

structure_type

character. The name of the geological structure type (e.g., "fault") to return a definition for.

structure_id

integer. The unique idenfication number(s) of geological structures(s) to return a definition for.

Value

A data.frame containing the following columns:

Developer(s)

William Gearty

Reviewer(s)

Lewis A. Jones

See Also

Geologic features and attributes: def_econs(), def_environments(), def_grain_sizes(), def_lithologies(), def_lithology_att(), def_measurements(), def_minerals()

Examples


# Get all structure definitions
ex1 <- def_structures()
# Get subset of structure definitions
ex2 <- def_structures(structure_id = c(1, 3))
ex3 <- def_structures(structure_class = "igneous")


Define timescales

Description

A function to retrieve all timescale definitions from the Macrostrat database. Function is called without user-specified arguments.

Usage

def_timescales()

Value

A data.frame containing the following columns:

Developer(s)

Lewis A. Jones

Reviewer(s)

Christopher D. Dean

See Also

Timescales and time intervals: def_intervals()

Examples


 # Retrieve all timescale definitions
 ex1 <- def_timescales()


Filters NULL and FALSE arguments from a list

Description

This function checks whether any elements in a list are NULL or FALSE and removes them.

Usage

filter_args(x, filter_null = TRUE, filter_false = TRUE)

Arguments

x

list. The user-query list

filter_null

logical. Should NULL value queries be filtered?

filter_false

logical. Should FALSE value queries be filtered?

Value

A NULL and FALSE filtered list of x.


Retrieve Macrostrat column age models

Description

A function to obtain information about the age models used for Macrostrat columns or sections. This consists of the temporal boundaries applied to the column's constituent units.

Usage

get_age_model(column_id = NULL, section_id = NULL)

Arguments

column_id

integer. Filter age models to those associated with column(s) as specified by their unique identification number(s).

section_id

integer. Filter age models to those associated with section(s) as specified by their unique identification number(s).

Details

The Macrostrat age models are used to determine the ages of the boundaries between units in an internally consistent manner, allowing each boundary to be dated with respect to all age information available for the column.

Value

A data.frame containing, for each boundary between units for each retrieved age model:

Developer(s)

Bethany Allen

Reviewer(s)

Lewis A. Jones

See Also

Macrostrat data entities: def_columns(), get_columns(), get_sections(), get_units()

Examples


 # Get age model for specific columns by ID
 ex1 <- get_age_model(column_id = c(503, 504))
 # Get age model for specific sections by ID
 ex2 <- get_age_model(section_id = c(65, 22))


Retrieve Macrostrat column data

Description

A function to retrieve independent, hexagonal, vertical columns which contain chronostratigraphically organised Macrostrat units.

Usage

get_columns(
  column_id = NULL,
  section_id = NULL,
  unit_id = NULL,
  strat_name = NULL,
  strat_name_id = NULL,
  interval_name = NULL,
  interval_id = NULL,
  age = NULL,
  age_top = NULL,
  age_bottom = NULL,
  lat = NULL,
  lng = NULL,
  lithology = NULL,
  lithology_id = NULL,
  lithology_type = NULL,
  lithology_class = NULL,
  lithology_att = NULL,
  lithology_att_id = NULL,
  lithology_att_type = NULL,
  environ = NULL,
  environ_id = NULL,
  environ_type = NULL,
  environ_class = NULL,
  pbdb_collection_no = NULL,
  econ = NULL,
  econ_id = NULL,
  econ_type = NULL,
  econ_class = NULL,
  project_id = NULL,
  adjacents = FALSE,
  sf = FALSE
)

Arguments

column_id

integer. Filter columns by their unique identification number(s).

section_id

integer. Filter columns to those containing section(s) as specified by their unique identification number(s).

unit_id

integer. Filter columns to those containing unit(s) as specified by their unique identification number(s).

strat_name

character. Filter columns to those containing a unit that fuzzy matches a stratigraphic name (e.g., "Hell Creek").

strat_name_id

integer. Filter columns to those containing a unit that matches one or more stratigraphic name(s) as specified by their unique identification number(s).

interval_name

character. Filter columns to those that overlap with a named chronostratigraphic time interval (e.g., "Permian").

interval_id

integer. Filter columns to those that overlap with a chronostratigraphic time interval as specified by their unique identification number(s).

age

numeric. Filter columns to those that overlap with the specified numerical age, in millions of years before present.

age_top

numeric. Filter columns to those that overlap with the age range between the specified numerical age and age_bottom. Should be in millions of years before present. age_bottom must also be specified, and this must be younger than age_bottom.

age_bottom

numeric. Filter columns to those that overlap with the age range between the specified numerical age and age_top. Should be in millions of years before present. age_top must also be specified, and this must be older than age_top.

lat

numeric. Return the column at the specified decimal degree latitude. Must also specify lng.

lng

numeric. Return the column at the specified decimal degree longitude. Must also specify lat.

lithology

character. Filter columns to those containing a named lithology (e.g., "shale", "sandstone").

lithology_id

integer. Filter columns to those containing one or more lithology(ies) identified by their unique identification number(s).

lithology_type

character. Filter columns to those containing a named lithology type (e.g., "carbonate", "siliciclastic").

lithology_class

character. Filter columns to those containing a named lithology class (e.g., "sedimentary", "igneous", "metamorphic").

lithology_att

character. Filter columns to those containing a named lithology attribute (e.g., "fine", "olivine", "poorly washed").

lithology_att_id

integer. Filter columns to those containing one or more lithology attribute(s) as specified by their unique identification number(s).

lithology_att_type

character. Filter columns to those containing a named category of lithology attribute (e.g., "grains", "lithology", "bedform").

environ

character. Filter columns to those containing a named environment (e.g., "delta plain", "pond").

environ_id

integer. Filter columns to those containing one or more environment(s) as specified by their unique identification number(s).

environ_type

character. Filter columns to those containing a named environment type (e.g., "fluvial", "eolian", "glacial").

environ_class

character. Filter columns to those containing a named environment class (e.g., "marine", "non-marine").

pbdb_collection_no

integer. Filter columns to those containing one or more Paleobiology Database collection(s) as specified by their unique identification number(s).

econ

character. Filter columns to those containing a named economic attribute (e.g., "brick", "ground water", "gold").

econ_id

integer. Filter columns to those containing one or more economic attribute(s) as specified by their unique identification number(s).

econ_type

character. Filter columns to those containing a named economic attribute type (e.g., "construction", "aquifer", "mineral").

econ_class

character. Filter columns to those containing a named economic attribute class (e.g., "material", "water", "precious commodity").

project_id

integer. Filter columns to those contained within a Macrostrat project as specified by its unique identification number.

adjacents

logical. If column_id or lat/lng is specified, should all columns that touch the specified column be returned? Defaults to FALSE.

sf

logical. Should the results be returned as an sf object? Defaults to FALSE.

Details

More information can be found for the inputs for this function using the definition functions (beginning with def_).

Value

A data.frame containing the following columns:

If sf is TRUE, an sf object is returned instead, with the same columns plus a "geometry" column that contains the spatial data.

Developer(s)

William Gearty

Reviewer(s)

Christopher D. Dean

See Also

Macrostrat data entities: def_columns(), get_age_model(), get_sections(), get_units()

Examples


# Return columns that overlap with a named chronostratigraphic interval
ex1 <- get_columns(interval_name = "Permian")
# Return columns that overlap with a specified age range
ex2 <- get_columns(age_top = 200, age_bottom = 250)
# Return columns that contain a specific stratigraphic unit, in `sf` format
ex3 <- get_columns(strat_name = "mancos", sf = TRUE)
# Return the columns at a specific geographic coordinate
ex4 <- get_columns(lat = 43, lng = -89, adjacents = TRUE)


Retrieve core data from ocean drilling programs

Description

A function to retrieve data from the Extending Ocean Drilling Pursuits (eODP) project, a collation of sedimentary description data from ocean drilling cores. This currently includes cores from the Deep Sea Drilling Project (DSDP), Integrated Ocean Drilling Program (IODP), and Ocean Drilling Program (ODP). Note: eODP data is currently being integrated into Macrostrat's data entities (e.g. columns and units) and should be available via get_columns() and get_units() in the future.

Usage

get_eodp(column_id = NULL, site = NULL, leg = NULL, program = NULL, sf = FALSE)

Arguments

column_id

integer. Filter cores by their unique identification number(s).

site

character. Filter cores to those from a particular drilling site (e.g., "U1351").

leg

character. Filter cores to those from a particular drilling leg or expedition (e.g., "317").

program

character. Filter cores to those from a particular drilling program ("DSDP", "IODP", or "ODP").

sf

logical. Should the results be returned as an sf object? Defaults to FALSE.

Details

More information can be found about the inputs for this function by using def_drilling_sites().

Value

A data.frame containing, for each retrieved core:

If sf is TRUE, an sf object is returned instead, with a "geometry" column that contains the spatial data instead of the lat/lng columns.

Developer(s)

Bethany Allen

Reviewer(s)

William Gearty

References

Sessa JA, Fraass AJ, LeVay LJ, Jamson KM, and Peters SE. (2023). The Extending Ocean Drilling Pursuits (eODP) Project: Synthesizing Scientific Ocean Drilling Data. Geochemistry, Geophysics, Geosystems, 24 (3) e2022GC010655. doi:10.1029/2022GC010655.

See Also

External data: def_drilling_sites(), def_measurements(), get_fossils(), get_measurements()

Examples


# Get data for specific cores
cores <- get_eodp(column_id = c(5081, 5082))
# Get data for all cores at a specific site
cores <- get_eodp(site = "U1351")
# Get data for all cores for a specific leg
cores <- get_eodp(leg = "317")
# Get data for all cores for a specific program
cores <- get_eodp(program = "IODP")


Retrieve collections from the Paleobiology Database

Description

A function to retrieve collections from the Paleobiology Database (PBDB), matched to Macrostrat units.

Usage

get_fossils(
  unit_id = NULL,
  column_id = NULL,
  interval_name = NULL,
  age = NULL,
  age_top = NULL,
  age_bottom = NULL,
  lithology = NULL,
  lithology_id = NULL,
  lithology_type = NULL,
  lithology_class = NULL,
  environ = NULL,
  environ_id = NULL,
  environ_type = NULL,
  environ_class = NULL,
  econ = NULL,
  econ_id = NULL,
  econ_type = NULL,
  econ_class = NULL,
  project_id = NULL,
  strat_name_id = NULL,
  sf = FALSE
)

Arguments

unit_id

integer. Filter PBDB collections to those within one or more unit(s) as specified by their unique identification number(s).

column_id

integer. Filter PBDB collections to those within one or more column(s) as specified by their unique identification number(s).

interval_name

character. Filter PBDB collections to those that overlap with a named chronostratigraphic time interval (e.g., "Permian").

age

numeric. Filter PBDB collections to those that overlap with the specified numerical age, in millions of years before present.

age_top

numeric. Filter PBDB collections to those that overlap with the age range between the specified numerical age and age_bottom. Should be in millions of years before present. age_bottom must also be specified, and this must be older than age_top.

age_bottom

numeric. Filter PBDB collections to those that overlap with the age range between the specified numerical age and age_top. Should be in millions of years before present. age_top must also be specified, and this must be younger than age_bottom.

lithology

character. Filter PBDB collections to those containing a named lithology (e.g., "shale", "sandstone").

lithology_id

integer. Filter PBDB collections to those containing one or more lithology(ies) identified by their unique identification number(s).

lithology_type

character. Filter PBDB collections to those containing a named lithology type (e.g., "carbonate", "siliciclastic").

lithology_class

character. Filter PBDB collections to those containing a named lithology class (e.g., "sedimentary", "igneous", "metamorphic").

environ

character. Filter PBDB collections to those containing a named environment (e.g., "delta plain", "pond").

environ_id

integer. Filter PBDB collections to those containing one or more environment(s) as specified by their unique identification number(s).

environ_type

character. Filter PBDB collections to those containing a named environment type (e.g., "fluvial", "eolian", "glacial").

environ_class

character. Filter PBDB collections to those containing a named environment class (e.g., "marine", "non-marine").

econ

character. Filter PBDB collections to those containing a named economic attribute (e.g., "brick", "ground water", "gold").

econ_id

integer. Filter PBDB collections to those containing one or more economic attribute(s) as specified by their unique identification number(s).

econ_type

character. Filter PBDB collections to those containing a named economic attribute type (e.g., "construction", "aquifer", "mineral").

econ_class

character. Filter PBDB collections to those containing a named economic attribute class (e.g., "material", "water", "precious commodity").

project_id

integer. Filter sections to those contained within a Macrostrat project as specified by its unique identification number.

strat_name_id

integer. Filter PBDB collections to those containing a unit that matches one or more stratigraphic name(s) as specified by their unique identification number(s).

sf

logical. Should the results be returned as an sf object? Defaults to FALSE.

Details

More information can be found for the inputs for this function using the definition functions (beginning with def_). Terminology related to the PBDB can be found at https://paleobiodb.org/#/ or in the suggested references below.

Value

A dataframe containing the following columns:

If sf = TRUE, an sf object is returned instead.

Developer(s)

Christopher D. Dean

Reviewer(s)

Lewis A. Jones

References

Peters, S.E. and McClennen, M. (2016). The Paleobiology Database application programming interface. Paleobiology, 42(1), pp. 1–7. doi:10.1017/pab.2015.39.

Uhen, M.D., Allen, B., Behboudi, N., Clapham, M.E., Dunne, E., Hendy, A., Holroyd, P.A., Hopkins, M., Mannion, P., Novack-Gottshall, P. and Pimiento, C. (2023). Paleobiology Database User Guide Version 1.0. PaleoBios, 40(11), pp. 1–56. doi:10.5070/P9401160531.

See Also

External data: def_drilling_sites(), def_measurements(), get_eodp(), get_measurements()

Examples


 # Get fossils by Macrostrat column ID
 ex1 <- get_fossils(column_id = 10)
 # Get fossils by Macrostrat unit ID
 ex2 <- get_fossils(unit_id = 6279)
 # Get fossils by lithology and age
 ex3 <- get_fossils(lithology = "sandstone", age_top = 66, age_bottom = 73)
 # Get fossils by environment type and age
 ex4 <- get_fossils(environ_type = "fluvial", age =  253)


Retrieve geologic map legend data

Description

A function to retrieve legend components from various geological maps.

Usage

get_map_legends(
  source_id = NULL,
  lithology_id = NULL,
  lithology_type = NULL,
  lithology_class = NULL,
  description = NULL,
  comments = NULL,
  scale = NULL,
  carto = NULL
)

Arguments

source_id

integer. Filter legend components to those in sources specified by their unique identification number(s).

lithology_id

integer. Filter legend components to those containing one or more lithology(ies) as specified by their unique identification number(s).

lithology_type

character. Filter legend components to those containing one or more named lithology type(s) (e.g., "carbonate", "siliciclastic").

lithology_class

character. Filter legend components to those containing one or more named lithology class(es) (e.g., "sedimentary", "igneous", "metamorphic").

description

character. Filter legend components to those containing the given character string in the map unit description field.

comments

character. Filter legend components to those containing the given character string in the map unit comments field.

scale

character. Filter legend components to those from maps of specific scale(s) in Macrostrat's system. Options are "tiny" (global), "small" (continental), "medium" (regional), or "large" (local).

carto

character. Filter legend components to those of specific scale(s) in Macrostrat's system. Options are "tiny" (global), "small" (continental), "medium" (regional), or "large" (local).

Details

Potential Macrostrat map scales are "tiny" (global), "small" (continental), "medium" (regional), or "large" (local).

Value

A dataframe containing the following columns:

Developer(s)

Christopher D. Dean

Reviewer(s)

William Gearty

See Also

Geologic maps: def_sources(), get_map_outcrop(), get_map_points()

Examples


 # Get legend components by ID of the original source map
 ex1 <- get_map_legends(source_id = 1)
 # Get legend components for any sedimentary lithologies
 ex2 <- get_map_legends(lithology_type = "sedimentary")
 # Get any legend components that have comments with the word 'breccia'
 ex3 <- get_map_legends(comments = "breccia")


Retrieve geologic map outcrop shape element data

Description

A function to retrieve data for geologic map outcrop shape elements from various sources.

Usage

get_map_outcrop(
  map_id = NULL,
  unit_id = NULL,
  strat_name_id = NULL,
  lat = NULL,
  lng = NULL,
  scale = NULL,
  sf = TRUE
)

Arguments

map_id

integer. The unique identification number(s) of the map outcrop shape element(s) to return.

unit_id

integer. Filter outcrop shape elements to those that match one or more Macrostrat unit(s) as specified by their unique identification number(s).

strat_name_id

integer. Filter outcrop shape elements to those that match one or more stratigraphic name(s) as specified by their unique identification number(s).

lat

numeric. Return the outcrop shape element(s) at the specified decimal degree latitude. Must also specify lng.

lng

numeric. Return the outcrop shape element(s) at the specified decimal degree longitude. Must also specify lat.

scale

character. The Macrostrat map scale to use (a vector of scales is also supported). Options are "tiny" (global), "small" (continental), "medium" (regional), or "large" (local).

sf

logical. Should the results be returned as an sf object? Defaults to TRUE. If FALSE, a data.frame is returned.

Details

More information can be found for the inputs for this function using the definition functions (beginning with def_).

Value

A data.frame containing the following columns:

If sf is TRUE (the default), an sf object is returned instead, with the same columns plus a "geometry" column that contains the spatial data.

Developer(s)

William Gearty

Reviewer(s)

Lewis A. Jones

See Also

Geologic maps: def_sources(), get_map_legends(), get_map_points()

Examples


ex1 <- get_map_outcrop(lat = 43, lng = -89.3)
ex2 <- get_map_outcrop(lat = 43, lng = -89.3, scale = "tiny")


Retrieve geologic map point shape element data

Description

A function to retrieve data for geologic map point shape elements from various sources.

Usage

get_map_points(
  point_id = NULL,
  point_type = NULL,
  min_lat = NULL,
  min_lng = NULL,
  max_lat = NULL,
  max_lng = NULL,
  source_id = NULL,
  sf = TRUE
)

Arguments

point_id

integer. The unique identification number(s) of the point(s) to return.

point_type

character. Filter points to those of one or more point type(s). Options are "cleavage", "bedding", "axial plane", "fault plane", "foliation", and "joint". Ignored if point_id is supplied.

min_lat

integer. The minimum latitude used to define the bounding box of the points to return. Requires min_lng, max_lat, and max_lng. Ignored if point_id is supplied.

min_lng

integer. A minimum longitude used to define the bounding box of the points to return. Requires min_lat, max_lat, and max_lng. Ignored if point_id is supplied.

max_lat

integer. A maximum latitude used to define the bounding box of the points to return. Requires min_lat, min_lng, and max_lng. Ignored if point_id is supplied.

max_lng

integer. A maximum longitude used to define the bounding box of the points to return. Requires min_lat, min_lng, and max_lat. Ignored if point_id is supplied.

source_id

integer. The unique identification number(s) of the source(s) to filter the points by. Ignored if point_id is supplied.

sf

logical. Should the results be returned as an sf object? Defaults to TRUE.

Details

More information can be found relating to the inputs for this function using the definition functions (beginning with def_).

Value

An sf object containing the following columns:

If sf is TRUE (the default), an sf object is returned, with the a "geometry" column that contains the spatial data. If sf is FALSE, a data.frame object is returned with two additional columns (lng, lat) containing the geographic coordinates of the point elements.

Developer(s)

Lewis A. Jones

Reviewer(s)

Bethany Allen

See Also

Geologic maps: def_sources(), get_map_legends(), get_map_outcrop()

Examples


# Return a specific point
ex1 <- get_map_points(point_id = 1)
# Return all points within a user-specified bounding box
ex2 <- get_map_points(min_lng = -80, min_lat = 40,
                      max_lng = -70, max_lat = 50)


Retrieve geological measurements

Description

Retrieve a range of measurements relevant to making geological inferences.

Usage

get_measurements(
  measure_id = NULL,
  measurement_id = NULL,
  measurement = NULL,
  measurement_type = NULL,
  measurement_class = NULL,
  measuremeta_id = NULL,
  measure_phase = NULL,
  column_id = NULL,
  section_id = NULL,
  unit_id = NULL,
  interval_name = NULL,
  lithology_id = NULL,
  lithology_type = NULL,
  lithology_class = NULL,
  project_id = NULL,
  sf = FALSE
)

Arguments

measure_id

integer. Filter measurements to those of one or more unique identification number(s).

measurement_id

integer. Filter measurements to those of one or more measurement definition(s) as specified by their unique identification number(s).

measurement

character. Filter measurements to those of one or more measurement definition(s) as specified by their name (e.g., "Pb" or "transport direction").

measurement_type

character. Filter measurements to those of one or more measurement definition type(s) (e.g., "major elements", "geochronological").

measurement_class

character. Filter measurements to those of one or more measurement definition class(es) (e.g., "geochemical", "geophysical").

measuremeta_id

integer. Filter measurements to those of one or more measurement metadata(s) (usually refers to a sample) as specified by their unique identification number(s).

measure_phase

character. Filter measurements by the phase from which the measurement was taken (e.g., "zircon", "whole rock").

column_id

integer. Filter measurements to those within one or more column(s) as specified by their unique identification number(s).

section_id

integer. Filter measurements to those within one or more section(s) as specified by their unique identification number(s).

unit_id

integer. Filter measurements to those within one or more unit(s) as specified by their unique identification number(s).

interval_name

character. Filter measurements to those from units within or touching a named interval(s) (e.g., "Permian").

lithology_id

integer. Filter measurements to those of one or more lithology(ies) as specified by their unique identification number(s).

lithology_type

character. Filter measurements to those of one or more lithology type(s) (e.g., "carbonate", "siliciclastic").

lithology_class

character. Filter measurements to those of one or more lithology class(es) (e.g., "sedimentary", "igneous", "metamorphic").

project_id

integer. Filter measurements by the unique identification number(s) of the Macrostrat project(s).

sf

logical. Should the results be returned as an sf object? Defaults to FALSE.

Details

More information can be found about the inputs and outputs for this function by using def_measurements().

Value

A data.frame containing the following columns:

If sf = TRUE, an sf object is returned instead, with the same columns plus a "geometry" column that contains the spatial data.

Developer(s)

Bethany Allen

Reviewer(s)

Christopher D. Dean

See Also

External data: def_drilling_sites(), def_measurements(), get_eodp(), get_fossils()

Examples


# Return measurements based on their specific IDs
ex1 <- get_measurements(measure_id = c(353, 354))
# Return measurements based on the ID of a specific measurement definition
ex2 <- get_measurements(measurement_id = 42)
# Return measurements for a specific measurement type
ex3 <- get_measurements(measurement = "SiO2")


Retrieve paleogeographic geometries

Description

A function to retrieve paleogeographic geometries reconstructed to a given a age or interval using the Wright et al. (2013) Global Plate Model.

Usage

get_paleogeography(age = NULL, interval_name = NULL)

Arguments

age

numeric. Return a paleogeographic reconstruction based on a numerical age in millions of years before present (between 0 and 550).

interval_name

character. Return a paleogeographic reconstruction based on a specified time interval. Ignored if age is supplied.

Details

More information for appropriate interval inputs for this function can be found using the def_intervals() function.

Value

An sf object containing the geometries of the paleogeographic map.

Developer(s)

Lewis A. Jones

Reviewer(s)

Christopher D. Dean

References

Wright, N., Zahirovic, S., Müller, R.D., Seton, M. (2013). Towards community-driven paleogeographic reconstructions: integrating open-access paleogeographic and paleobiology data with plate tectonics. Biogeosciences, 10, 1529–1541. doi:10.5194/bg-10-1529-2013.

See Also

Paleogeography: def_plates()

Examples


 # Get paleogeographic map via age
 ex1 <- get_paleogeography(age = 250)
 # Get paleogeographic map via interval name


Retrieve Macrostrat section data

Description

A function to retrieve Macrostrat units contained within gap-bound packages (sections).

Usage

get_sections(
  section_id = NULL,
  column_id = NULL,
  unit_id = NULL,
  strat_name = NULL,
  strat_name_id = NULL,
  interval_name = NULL,
  interval_id = NULL,
  age = NULL,
  age_top = NULL,
  age_bottom = NULL,
  lat = NULL,
  lng = NULL,
  lithology = NULL,
  lithology_id = NULL,
  lithology_group = NULL,
  lithology_type = NULL,
  lithology_class = NULL,
  lithology_att = NULL,
  lithology_att_id = NULL,
  lithology_att_type = NULL,
  environ = NULL,
  environ_id = NULL,
  environ_type = NULL,
  environ_class = NULL,
  pbdb_collection_no = NULL,
  econ = NULL,
  econ_id = NULL,
  econ_type = NULL,
  econ_class = NULL,
  project_id = NULL,
  adjacents = FALSE
)

Arguments

section_id

integer. Filter sections by their unique identification number(s).

column_id

integer. Filter sections to those contained within column(s) as specified by their unique identification number(s).

unit_id

integer. Filter sections to those containing unit(s) as specified by their unique identification number(s).

strat_name

character. Filter sections to those containing a unit that fuzzy matches a stratigraphic name (e.g., "Hell Creek").

strat_name_id

integer. Filter sections to those containing a unit that matches one or more stratigraphic name(s) as specified by their unique identification number(s).

interval_name

character. Filter sections to those that overlap with a named chronostratigraphic time interval (e.g., "Permian").

interval_id

integer. Filter sections to those that overlap with a chronostratigraphic time interval as specified by their unique identification number(s).

age

numeric. Filter sections to those that overlap with the specified numerical age, in millions of years before present.

age_top

numeric. Filter sections to those that overlap with the age range between the specified numerical age and age_bottom. Should be in millions of years before present. age_bottom must also be specified, and this must be younger than age_bottom.

age_bottom

numeric. Filter sections to those that overlap with the age range between the specified numerical age and age_top. Should be in millions of years before present. age_top must also be specified, and this must be older than age_top.

lat

numeric. Return the sections at the specified decimal degree latitude. Must also specify lng.

lng

numeric. Return the sections at the specified decimal degree longitude. Must also specify lat.

lithology

character. Filter sections to those containing a named lithology (e.g., "shale", "sandstone").

lithology_id

integer. Filter sections to those containing one or more lithology(ies) as specified by their unique identification number(s).

lithology_group

character. Filter sections to those containing a named lithology group (e.g., "sandstones", "mudrocks", "unconsolidated").

lithology_type

character. Filter sections to those containing a named lithology type (e.g., "carbonate", "siliciclastic").

lithology_class

character. Filter sections to those containing a named lithology class (e.g., "sedimentary", "igneous", "metamorphic").

lithology_att

character. Filter sections to those containing a named lithology attribute (e.g., "fine", "olivine", "poorly washed").

lithology_att_id

integer. Filter sections to those containing one or more lithology attribute(s) as specified by their unique identification number(s).

lithology_att_type

character. Filter sections to those containing a named category of lithology attribute (e.g., "grains", "lithology", "bedform").

environ

character. Filter sections to those containing a named environment (e.g., "delta plain", "pond").

environ_id

integer. Filter sections to those containing one or more environment(s) as specified by their unique identification number(s).

environ_type

character. Filter sections to those containing a named environment type (e.g., "fluvial", "eolian", "glacial").

environ_class

character. Filter sections to those containing a named environment class (e.g., "marine", "non-marine").

pbdb_collection_no

integer. Filter sections to those containing one or more Paleobiology Database collection(s) as specified by their unique identification number(s).

econ

character. Filter sections to those containing a named economic attribute (e.g., "brick", "ground water", "gold").

econ_id

integer. Filter sections to those containing one or more economic attribute(s) as specified by their unique identification number(s).

econ_type

character. Filter sections to those containing a named economic attribute type (e.g., "construction", "aquifer", "mineral").

econ_class

character. Filter sections to those containing a named economic attribute class (e.g., "material", "water", "precious commodity").

project_id

integer. Filter sections to those contained within one or more Macrostrat project(s) as specified by their unique identification number(s).

adjacents

logical. If column_id or lat/lng is specified, should all sections that touch the specified column be returned? Defaults to FALSE.

Details

More information can be found for the inputs for this function using the definition functions (beginning with defs_).

Value

A dataframe containing the following columns:

Developer(s)

Christopher D. Dean

Reviewer(s)

Bethany Allen

See Also

Macrostrat data entities: def_columns(), get_age_model(), get_columns(), get_units()

Examples


# Get sections within a specified column
ex1 <- get_sections(column_id = 10)
# Get sections at a specific geographic coordinate
ex2 <- get_sections(lng = -110.9, lat = 48.4)


Retrieve Macrostrat database statistics

Description

A function to retrieve various statistics about each Macrostrat project in the Macrostrat database. Function is called without user-specified arguments.

Usage

get_stats()

Value

A data.frame containing the following columns:

Developer(s)

William Gearty

Reviewer(s)

Bethany Allen

See Also

Macrostrat database metadata: def_projects(), def_references(), def_sources()

Examples


# Return all project statistics
ex1 <- get_stats()


Retrieve Macrostrat unit data

Description

A function to retrieve Macrostrat unit data matching a user-specified search criteria.

Usage

get_units(
  unit_id = NULL,
  section_id = NULL,
  column_id = NULL,
  strat_name = NULL,
  strat_name_id = NULL,
  interval_name = NULL,
  interval_id = NULL,
  age = NULL,
  age_top = NULL,
  age_bottom = NULL,
  lat = NULL,
  lng = NULL,
  lithology = NULL,
  lithology_id = NULL,
  lithology_group = NULL,
  lithology_type = NULL,
  lithology_class = NULL,
  lithology_att = NULL,
  lithology_att_id = NULL,
  lithology_att_type = NULL,
  environ = NULL,
  environ_id = NULL,
  environ_type = NULL,
  environ_class = NULL,
  pbdb_collection_no = NULL,
  econ = NULL,
  econ_id = NULL,
  econ_type = NULL,
  econ_class = NULL,
  project_id = NULL,
  adjacents = FALSE,
  sf = FALSE
)

Arguments

unit_id

integer. Filter units by their unique identification number(s).

section_id

integer. Filter units to those contained within section(s) as specified by their unique identification number(s).

column_id

integer. Filter units to those contained within column(s) as specified by their unique identification number(s).

strat_name

character. Filter units to those containing a unit that fuzzy matches a stratigraphic name (e.g., "Hell Creek").

strat_name_id

integer. Filter units to those that match one or more stratigraphic name(s) as specified by their unique identification number(s).

interval_name

character. Filter units to those that overlap with a named chronostratigraphic time interval (e.g., "Permian").

interval_id

integer. Filter units to those that overlap with one or more chronostratigraphic time interval(s) as specified by their unique identification number(s).

age

numeric. Filter units to those that overlap with the specified numerical age, in millions of years before present.

age_top

numeric. Filter units to those that overlap with the age range between the specified numerical age and age_bottom. Should be in millions of years before present. age_bottom must also be specified, and age_top must be younger than age_bottom.

age_bottom

numeric. Filter units to those that overlap with the age range between the specified numerical age and age_top. Should be in millions of years before present. age_top must also be specified, and age_bottom must be older than age_top.

lat

numeric. Return the units at the specified decimal degree latitude. Must also specify lng.

lng

numeric. Return the units at the specified decimal degree longitude. Must also specify lat.

lithology

character. Filter units to those containing a named lithology (e.g., "shale", "sandstone").

lithology_id

integer. Filter units to those containing one or more lithology(ies) as specified by their unique identification number(s).

lithology_group

character. Filter units to those containing a named lithology group (e.g., "sandstones", "mudrocks", "unconsolidated").

lithology_type

character. Filter units to those containing a named lithology type (e.g., "carbonate", "siliciclastic").

lithology_class

character. Filter units to those containing a named lithology class (e.g., "sedimentary", "igneous", "metamorphic").

lithology_att

character. Filter units to those containing a named lithology attribute (e.g., "fine", "olivine", "poorly washed").

lithology_att_id

integer. Filter units to those containing one or more lithology attribute(s) as specified by their unique identification number(s).

lithology_att_type

character. Filter units to those containing a named category of lithology attribute (e.g., "grains", "lithology", "bedform").

environ

character. Filter units to those containing a named environment (e.g., "delta plain", "pond").

environ_id

integer. Filter units to those containing one or more environment(s) as specified by their unique identification number(s).

environ_type

character. Filter units to those containing a named environment type (e.g., "fluvial", "eolian", "glacial").

environ_class

character. Filter units to those containing a named environment class (e.g., "marine", "non-marine").

pbdb_collection_no

integer. Filter units to those containing one or more Paleobiology Database collection(s) as specified by their unique identification number(s).

econ

character. Filter units to those containing a named economic attribute (e.g., "brick", "ground water", "gold").

econ_id

integer. Filter units to those containing one or more economic attribute(s) as specified by their unique identification number(s).

econ_type

character. Filter units to those containing a named economic attribute type (e.g., "construction", "aquifer", "mineral").

econ_class

character. Filter units to those containing a named economic attribute class (e.g., "material", "water", "precious commodity").

project_id

integer. Filter units to those contained within one or more Macrostrat project(s) as specified by their unique identification number(s).

adjacents

logical. If column_id or lat/lng is specified, should all units that touch the specified column be returned? Defaults to FALSE.

sf

logical. Should the results be returned as an sf object? Defaults to FALSE.

Details

More information can be found for the inputs for this function using the definition functions (beginning with def_).

Value

A data.frame containing the following columns:

If sf is TRUE, an sf object is returned instead, with a "geometry" column that contains the spatial data instead of the clat/clng columns.

Developer(s)

Lewis A. Jones

Reviewer(s)

William Gearty

See Also

Macrostrat data entities: def_columns(), get_age_model(), get_columns(), get_sections()

Examples


# Get units with a specific stratigraphic name
ex1 <- get_units(strat_name = "Hell Creek")
# Get units at a specific geographic coordinate
ex2 <- get_units(lng = -110.9, lat = 48.4)


API root (base URL)

Description

API root (base URL)

Usage

root()