Description Usage Arguments Value Checks Examples
View source: R/check-trapping.r
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.
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)
|
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. |
A data frame of records that failed the checks.
The following checks have been implemented:
check_trapping_loc
: all locs should conform to the standard
format for reflos, e.g. A.5, 22.0, or -1.5. Use reflo = FALSE
to
allow any valid loc instead of just reflos.
check_trapping_colours
: check for valid colours.
check_trapping_tags
: check for valid tags, i.e. a letter
followed by 4 numbers.
check_trapping_weight
: highlight records with suspicious bag
or squirrel weights. In general, bags should be between 75 and 170 grams
and squirrels between 70 and 390 grams. If missing_wt = TRUE
, also
highlight squirrels with missing or zero weights, unless the comments
suggest they were released without handling. By default missing weights
are not highlighted because there are many cases where weights are
intentionally not taken.
check_trapping_collwt
: any squirrel with collar fate of 2
("rc on"), 3 ("rc off"), or 4 ("rc change") should have a collar weight
of either 4 or 8 grams entered.
check_trapping_dna
: DNA vial numbers should be composed of
the grid, followed by the 2 digit year, then 4 numbers, e.g. KL151234.
check_trapping_newdna
: all newly caught squirrels and
squirrels with ripped tags in both ears (i.e. RIP/RIP) should have DNA.
check_trapping_fate
: all trapping records should have an
associated fate. In most cases, this function identifies cases where
the observer forgot to enter the "recap" fate.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.