querySpPresence: Tables of species presence by conglomerate.

Description Usage Arguments Value Examples

Description

Search for species records in Invaders, Footprints, Specimens and Camera tables.

Usage

1
querySpPresence(database, noms, malla = NULL)

Arguments

database

Connection to an existing postgresql or sqlite database (as returned by src_postgres or src_sqlite.

noms

String indicating the species names to look for (ex: "vaca|equus")

malla

Optional parameter indicating the coordinates of the conglomerates, malla most be a data.frame with columns cgl_id, lng, lat, where cgl_id is the conglomerate id (class double), lng is longitude and lat is latitude. If malla is left to NULL the function will return the coordinates from the conglomerate Center specified in the database.

Value

A list with 2 elements (both have class data.frame):

  1. The first element is indexed by conglomerate id (Id) and includes only the conglomerates where the species specified by noms were found, its columns are: Estado, Municipio, and Uso suelo, it also includes an indicator of the kind of records found, this is, if records belong to invaders (EI), footprints/feces (HE), opportunistic invaders (EI ex), opportunistic footprints/feces, opportunistic specimens/remains (ER ex) or camera trap (Cámara).

  2. The second element is indexed by conglomerate id (Id) and includes only the conglomerates where the species specified by noms were found, the columns are the coordinates of the conglomerate (lng, lat), the coordinates can be supplied by the user (throught the parameter malla) or taken from the database.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# connect to sqlite database (snmb)
database <- dplyr::src_sqlite(system.file("extdata", "snmb.sqlite",
  package = "querysnmb"))
presence_cows <- querySpPresence(database, noms = "vaca|bos|taurus")
## Not run: 
# connect to postgreSQL database (snmb)
PASS_SNMB = Sys.getenv("PASS_SNMB")
database <- dplyr::src_postgres(dbname = "snmb", host = "dbms", user =
  "snmb", password = PASS_SNMB)
presence_cows <- querySpPresence(database, noms = "vaca|bos|taurus")

## End(Not run)

tereom/querysnmb documentation built on May 31, 2019, 8:39 a.m.