queryCgls: Basic table by conglomerate-date.

Description Usage Arguments Value Examples

Description

queryCgls creates basic tables by conglomerate-date.

Usage

1
2
queryCgls(database, state = "all", organization = "all", cgl_id = "all",
  year_visit = 2010:2016, month_visit = 1:12)

Arguments

database

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

state

Character vector of Mexican states to include in the searh, defaults to "all".

organization

Character vector of organizations to include in the search (CONAFOR, CONANP, FMCN), defaults to "all".

cgl_id

Character vector of conglomerate ids to include in the searh, defaults to "all".

year_visit

Numeric vector indicating the year(s) to include in the search, defaults to 2014:2016.

month_visit

Numeric vector indicating the month(s) to include in the search, defaults to 1:12.

Value

A data.frame where each line corresponds to a conglomerate-date, filtered by state, organization, cgl_id, year, and month, the data.frame includes conglomerate name, coordinates of the conglomerate center, date of visit, organization, state, municipality, monitoring type, vegetation, and perturbated.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# connect to sqlite database (snmb)
database <- dplyr::src_sqlite(system.file("extdata", "snmb.sqlite",
  package = "querysnmb"))
cgl_table <- queryCgls(database)
cgl_table <- queryCgls(database, organization = "CONAFOR", year = 2014)

## 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)
cgl_table <- queryCgls(database)
cgl_table <- queryCgls(database, organization = "CONAFOR", year = 2014)

## End(Not run)

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