check_collars: Check radio collars

Description Usage Arguments Value Checks Examples

View source: R/check-collars.r

Description

Check that radio collars have been correctly entered into the trapping table.

Usage

1
check_collars(con, grid, year)

Arguments

con

Connection to KRSP database

grid

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

year

integer; year to search within. Defaults to current year.

Value

A data frame of records that failed the checks.

Checks

The following checks have been implemented:

  1. All trapping records with radio = 1 (new collar), 2 (collar on), 3 (collar change), or 4 (collar removed) should have a radio collar frequency in the collar field.

  2. Radio collar frequencies should all be 6 digits with no decimal. If a decimal is used the frequency will get rounded to the nearest integer, e.g. 150.231 -> 150.

  3. Any squirrel with radio = 2 (collar on), 3 (collar change) or 4 (collar removed) should have a previous record with radio = 1 (new collar).

  4. All squirrels that currently have no collar (radio = 5), but previously had a collar (radio = 1-3), should have record for a collar removal (radio = 4).

Examples

1
2
con <- krsp_connect()
check_collars(con, grid = "KL", year = 2014)

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