This function is useful for selecting records according to their taxonomic status. By default, only records with accepted scientific names are returned.

bdc_filter_out_names(
  data,
  col_name = "notes",
  taxonomic_status = "accepted",
  opposite = FALSE
)

Arguments

data

data.frame. Containing the column "notes" with information on the taxonomic status of scientific names.

col_name

character string. The column name containing notes about the taxonomic status of a name. Default = "notes".

taxonomic_status

character string. Taxonomic status of a name. Default = "accepted".

opposite

logical. Should taxonomic status different from those listed in 'taxonomic_status' be returned? Default = FALSE

Value

A data.frame filtered out according to names listed in 'taxonomic_status'.

Details

By default, only records with accepted scientific names are kept in the database. Such records are listed in the column 'taxonomic_status' as "accepted", "accepted | replaceSynonym", "accepted | wasMisspelled" or "accepted | wasMisspelled | replaceSynonym". It is also possible to customize the list of taxonomic notes to be kept in the argument 'taxonomic_status'. See 'notes' in the data.frame resulted from the function bdc_create_report. If 'opposite' is TRUE, records with notes different from names listed in 'taxonomic_status' are returned.

See also

Examples

df_notes <-
  data.frame(
    notes = c(
      "notFound", "accepted", "accepted | replaceSynonym",
      "accepted | wasMisspelled",
      "accepted | wasMisspelled | replaceSynonym",
      "multipleAccepted",
      "heterotypic synonym"
    )
  )

bdc_filter_out_names(
  data = df_notes,
  taxonomic_status = "accepted",
  col_name = "notes",
  opposite = FALSE
)
#>                                       notes
#> 1                                  accepted
#> 2                 accepted | replaceSynonym
#> 3                  accepted | wasMisspelled
#> 4 accepted | wasMisspelled | replaceSynonym