Skip to contents

Import survey field data from egg traps, or retrieve the data from a sit object.

Usage

sit_egg_surveys(x, ...)

# S3 method for data.frame
sit_egg_surveys(
  x,
  trap = "trap",
  type = "type",
  survey = "survey",
  activation = "activation",
  duration = "duration",
  species = "species",
  fertile = "fertile",
  n = "n",
  ...
)

# S3 method for sit
sit_egg_surveys(
  x,
  area = c("control", "sit"),
  trap_type = sit_trap_types(x)$label,
  following_releases,
  following_days,
  species = NULL,
  ...
)

Arguments

x

A data.frame with field survey data in tidy format.

...

Used to pass arguments to specific method.

trap

Identification code of the trap. This is the user’s code corresponding to the id argument in sit_traps().

type

Character string. Trap type.

survey

Character. Date and optionally the time of the survey. See details on the date format.

activation

Character. Date and optionally the time of the survey activation. See details on the date format. Either activation or duration are required.

duration

Numeric. Number of days (integer or fractional) that the trap has been functioning.

species

Character.

fertile

Logical. Whether n represents counts of fertile eggs (TRUE) of sterile eggs (FALSE).

n

Mandatory. An integer number of the surveyed individuals in the corresponding group.

area

Character vector. Either control, sit or both (default).

trap_type

Character vector. Any subset of unique(sit_trap_types(x)$label).

following_releases

A sit_release object with a subset of release events or missing (default) for all release events. Use in combination with following_days to filter surveys of the target populations within a given number of days after release. Note that counts of wild populations will always be included in the results with a value of NA in pop_col.

following_days

Integer or missing (default). Number of days after releases to return, if following_releases is not missing.

Value

A object of class sit_egg_surveys which can be used in sit().

Details

The argument type is mandatory only if needed to uniquely identify the trap (i.e., more than one egg trap type is declared with sit_trap_types() and the same code has been used for traps of different types). If the user used unique codes for each trap, which will be checked internally, this is redundant and will be ignored in any case.

Dates must be provided in the RFC 3339 format (a variation of the ISO 8601 format), i.e., 2021-12-31 or 2019-11-23 15:00.

Methods (by class)

  • data.frame: Imports field survey data from egg traps.

  • sit: Retrieve egg survey data, possibly filtering results.

See also

sit()

Other importing: sit_adult_surveys(), sit_revents(), sit_traps()

Examples

egg_surv <- data.frame(
  trap = 1:3,
  survey = c("2021-04-01", "2021-08-21", "2021-08-21"),
  duration = rep(7L, 3),
  fertile = c(TRUE, FALSE, TRUE),
  n = 1:3
)
sit_egg_surveys(egg_surv)
#>   id trap_code datetime_start datetime_end fertile n
#> 1  1         1     2021-03-25   2021-04-01    TRUE 1
#> 2  2         2     2021-08-14   2021-08-21   FALSE 2
#> 3  3         3     2021-08-14   2021-08-21    TRUE 3