| filter.sites {neotoma2} | R 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:
-
siteidA numeric site identifier from the Neotoma Database. -
sitenameThe character string sitename. -
latA numeric latitude value. -
longA numeric longitude value. -
altitudeThe 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. -
datasetidA numeric datasetid from Neotoma. -
databaseA character string naming the constituent database from which the dataset is drawn. -
datasettypeA character string representing one of the many dataset types within Neotoma. -
age_range_oldA dataset-level parameter indicating the oldest date covered by the dataset chronology. -
age_range_youngA dataset-level parameter indicating the youngest date covered by the dataset chronology. -
notesFree-form dataset notes provided by the dataset PI(s), analysts or data stewards. -
collectionunitidA numeric collection unit identifier from Neotoma. -
handleA character string identifying the collection unit. These are often shorter form names (originally a default 8 character length). -
collectionunitnameA character string identifying the collection unit name. -
colldateThe date on which the collection unit was sampled. Many of these are empty. -
locationA free-form character string indicating the location of the collection unit within the site. -
waterdepthA numeric depth at which the core was obtained. -
collunittypeA character string for the collection unit type. -
collectiondeviceA fixed vocabulary term for the collection device. -
depositionalenvironmentA 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")