filter.sites: Apply a filter for Neotoma sites objects.

View source: R/filter.R

filter.sitesR Documentation

Apply a filter for Neotoma sites objects.

Description

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.

Usage

## S3 method for class 'sites'
filter(x, ...)

Arguments

x

A sites object.

...

arguments to filter by.

Value

filtered sites object

Examples


# 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")


neotoma2 documentation built on May 29, 2024, 6:21 a.m.