list_e: List entities in the EPD

Description Usage Arguments Value Examples

View source: R/EPDr-list_functions.R

Description

This function allows to search entities records by different search criteria that can be combined as desired.

Usage

1
2
3
4
list_e(connection, site = NULL, coords = NULL, lastname = NULL,
  firstname = NULL, initials = NULL, publ = NULL, country = NULL,
  region = NULL, shapefile = NULL, restrictions = NULL,
  logical_operator = "AND")

Arguments

connection

PostgreSQLConnection A valid connection to the database. See connect_to_epd.

site

numeric Numeric or character vector indicating the site identification number or the site name to which entities will be retrieved.

coords

numeric Numeric vector with four elements indicating the geographical coordinates to which the search is limited.

lastname

character Character vector indicating the last name of data contributor for which entities will be retrieved.

firstname

character Character vector indicating the first name of data contributor for which entities will be retrieved.

initials

character Character vector indicating the initials of data contributor for which entities will be retrieved.

publ

numeric Numeric vector indicating the publication identification number to which search is constrained.

country

character Character vector indicating the three letters code or the full english name for the countries to which entities are desired.

region

character Character vector indicating the two letters code or the full name for the regions to which entities are desired. To specify a region you have to specify one, and only one, country. You can specify multiple countries but the results can be funky.

shapefile

SpatialPolygonsDataFrame SpatialPolygonsDataFrame object to which the query is going to be restricted.

restrictions

character Character letter ("U" or "R") specifying the usestatus of the data for the entities that are searched. U is for unrestricted and R is for restricted.

logical_operator

character Character string indicating whether the effects of search criteria are additive ("OR") or substracting ("AND"). If "OR" is specified, entities complying with any of the search criteria will be returned. If "AND" is specified, only entities that comply with all search criteria will be returned.

Value

This function return a data.frame with columns as in the entity table of the EPD database (see documentation of the EPD: http://www.europeanpollendatabase.net/data/downloads/image/pollen-database-manual-20071011.doc). If search criteria are all empty, the function returns the whole table. If criteria are specified the table is complemented with columns from diferent tables in the database that store the required information to filter entities accordingly.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
epd.connection <- connect_to_epd(host = "localhost", database = "epd",
                              user = "epdr", password = "epdrpw")
list_e(epd.connection)
list_e(epd.connection, site = 1)
list_e(epd.connection, site = "Adange")
list_e(epd.connection, site = c(1:10))
list_e(epd.connection, country = "ESP")
list_e(epd.connection, country = "Spain")
list_e(epd.connection, country = "Spain", region = "Andalucia")
list_e(epd.connection, lastname = "Tzedakis")
list_e(epd.connection, restrictions = "R")

## End(Not run)

dinilu/EPDr documentation built on Aug. 22, 2019, 1:03 p.m.