Skip to contents

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)

Arguments

x

A sit object, a data.frame-like object or empty.

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().

Methods (by class)

  • sit: Extract trap data

  • data.frame: Import trap data

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