check_trapping: Check records in trapping table

Description Usage Arguments Value Checks Examples

View source: R/check-trapping.r

Description

Perform data integrity checks on the trapping table. Run all checks at once with check_trapping(), or perform individual checks with the specific functions outlined below.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
check_trapping(con, grid, year, observer)

check_trapping_loc(con, grid, year, observer, reflo = TRUE)

check_trapping_colours(con, grid, year, observer)

check_trapping_tags(con, grid, year, observer)

check_trapping_weight(con, grid, year, observer, missing_wt = FALSE)

check_trapping_collwt(con, grid, year, observer)

check_trapping_dna(con, grid, year, observer)

check_trapping_newdna(con, grid, year, observer)

check_trapping_fate(con, grid, year, observer)

Arguments

con

Connection to KRSP database

grid

character; one or more grids to search. Defaults to all grids.

year

integer; one or more years to search within. Defaults to all years.

observer

character; one or more observers to highlight errors for. Defaults to all observers.

reflo

logical; whether to only allow reflos (e.g. A.5, 22.0) or any valid loc (e.g. A.7, 22.1).

missing_wt

logical; whether to highlights weights that are missing or only weights that are not within the typical range.

Value

A data frame of records that failed the checks.

Checks

The following checks have been implemented:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
con <- krsp_connect()
# run individual checks
check_trapping_loc(con, grid = "AG", year = 2015)
check_trapping_loc(con, grid = "AG", year = 2015, reflo = FALSE)
check_trapping_colours(con, grid = "JO", year = 2011)
check_trapping_tags(con, year = 2014)
check_trapping_weight(con, grid = "SU", year = 2015)
check_trapping_collwt(con, grid = "KL", year = 2015)
check_trapping_dna(con, grid = "KL")
check_trapping_newdna(con, year = 2015)
check_trapping_fate(con, year = 2015)
# or perform them all at once
check_trapping(con, year = 2014) %>%
  count(check)

mstrimas/krsp documentation built on May 23, 2019, 8:16 a.m.