Import or extract trap types
sit_trap_types.Rd
Extracts the table of trap types used in a sit
experiment, or defines
a table of trap types.
Usage
sit_trap_types(x)
# S3 method for sit
sit_trap_types(x)
# S3 method for data.frame
sit_trap_types(x)
Value
Table of trap types used in the sit
experiment x
. If x
is a
data.frame
, returns it as a table of trap types after some verifications.
If x
is missing, returns the current table of trap types.
Details
Returns the table of trap types used in the sit
object x
.
Defines a table of trap types by passing a data.frame
with variables
name
, label
, stage
(either egg
or adult
) and optionally
description
. Any other variable is ignored with a warning.
Returns the default table of trap types by calling sit_trap_types()
without any argument.
Check the default trap types with sit_trap_types()
.
You can store the table into an object and make edits as for a regular
data.frame
. E.g. add another trap type, or edit labels or descriptions.
You can use the edited object as an input to the trap_types
arguments in
sit_traps()
.
Examples
sit_trap_types() # default trap types.
#> id name label stage description
#> 1 1 Ovitrap OVT egg NA
#> 2 2 BG-Sentinel BGS adult NA
#> 3 3 Human Landing Catch HLC adult NA
# Define new trap types
my_traps <- data.frame(name = "My New Trap", label = "MNT", stage = "adult")
sit_trap_types(my_traps)
#> id name label stage description
#> 1 1 My New Trap MNT adult NA