get_sites {neotoma2}R Documentation

get_sites

Description

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.

Usage

get_sites(x = NA, ...)

Arguments

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.

Details

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:

Value

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.

Author(s)

Socorro Dominguez s.dominguez@ht-data.com

Examples


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


[Package neotoma2 version 1.0.3 Index]