Import or retrieve adult surveys
sit_adult_surveys.Rd
Import survey field data from adult traps, or retrieve the data from a sit
object.
Usage
sit_adult_surveys(x, ...)
# S3 method for data.frame
sit_adult_surveys(
x,
trap = "trap",
type = "type",
survey = "survey",
activation = "activation",
duration = "duration",
population = "population",
species = "species",
sex = "sex",
n = "n",
...
)
# S3 method for sit
sit_adult_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 insit_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
orduration
are required.- duration
Numeric. Number of days (integer or fractional) that the trap has been functioning.
- population
Character. Either
wild
or any of the colour codes in the release events imported withsit_revents()
.- species
Character. Only required if the counts of wild individuals are further categorised by species. Make sure to use the same nomenclature as in
sit_revents()
. In the extraction method, a character vector of species to be returned. Defaults toNULL
, which ignores the species variable.- sex
Character. Either
male
orfemale
.- 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 withfollowing_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 ofNA
inpop_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_adult_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 adult 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 adult traps.sit
: Retrieve adult survey data, possibly filtering results.
See also
Other importing:
sit_egg_surveys()
,
sit_revents()
,
sit_traps()
Examples
ad_surv <- data.frame(
trap = 1:3,
survey = c("2021-04-01", "2021-08-21", "2021-08-21"),
duration = rep(7L, 3),
population = c("blue", "yellow", "yellow"),
species = "aeg",
sex = c("male", "male", "female"),
n = 1:3
)
sit_adult_surveys(ad_surv)
#> id trap_code pop_col datetime_start datetime_end species sex n
#> 1 1 1 blue 2021-03-25 2021-04-01 aeg male 1
#> 2 2 2 yellow 2021-08-14 2021-08-21 aeg male 2
#> 3 3 3 yellow 2021-08-14 2021-08-21 aeg female 3