Skip to contents

This function detects invasive species in occurrence data based on a list of invasive species and a reference list. It can keep or remove invasive species from the occurrence data, and can also return only the invasive species from the occurrence data. The function will use a list of invasive fish species from Paraná state in Brazil as default in case no invasive_list is provided. The list was published by

Usage

rfs_detect_invasive(
  occ_df,
  invasive_list = NULL,
  reference_list,
  keep_invasive = TRUE,
  invasive_only = FALSE
)

Arguments

occ_df

The occurrence data as a data frame. Obtained from rFishStatus::rfs_join_basins().

invasive_list

A dataframe indicating species, basins and if the species is invasive (1) or not (0). Dataframe must have the columns 'species', 'basin' and 'invasive'.

reference_list

A reference database if species obtained from rFishStatus::rfs_get_species_list().

keep_invasive

A logical value indicating whether to keep invasive species in the occurrence data. Default is TRUE, which keeps invasive species.

invasive_only

A logical value indicating whether to return only the invasive species in the occurrence data. Default is FALSE, which returns all species.

Value

The filtered occurrence data as a data frame.

Examples

if (FALSE) { # \dontrun{
# Filter invasive species and keep only non-invasive species
filtered_data <- rfs_detect_invasive(occ_df, invasive_list,
                                     reference_list, keep_invasive = FALSE)
} # }