This function validates species distribution data provided in a data frame against the known mammal species lists and a departamentos map. It outputs a data frame with validation results and additional information.

mamm_coords_validator(
  df,
  sp_names,
  taxon = NULL,
  colmap_d = NULL,
  lon = NULL,
  lat = NULL,
  adm_names = NULL,
  oceanmap = NULL,
  oce_adm_names = NULL
)

Arguments

df

A data frame containing species distribution data with columns 'species', 'decimalLongitude', and 'decimalLatitude'.

sp_names

Name of the column containing species names (Genus + Specific Epithet).

taxon

A data frame with distribution information, including 'scientificName' and 'distribution'. The scientificName must be in binomial form, and the distribution should contain names separated by |. By default, the function uses the checklist available at https://www.gbif.org/dataset/e8b9ed9b-f715-4eac-ae24-772fbf40d7ae.

colmap_d

A spatial object in vector format representing the geographic area to validate against. By default, the function uses the Colombia Administrative Boundaries available in the geodata package.

lon

Name of the column containing longitude values in df. Default is 'decimalLongitude'.

lat

Name of the column containing latitude values in df. Default is 'decimalLatitude'.

adm_names

Name of the column in colmap representing administrative boundaries. Default is 'NAME_1'.

oceanmap

A spatial object representing the ocean area to validate against.

oce_adm_names

Name of the column in oceanmap representing administrative boundaries for ocean areas. Default is 'ocean'.

Value

A data frame with validated species records and validation results.

Details

This function validates species distribution data by checking species names against a known list and verifying geographic coordinates against political maps ('colmap_d' and 'oceanmap'). 'colmap_d' is downloaded internally using the geodata package. It assigns a validation result ('validation_result') where 1 means coincidence and 0 means no match. Additional details are provided in the returned data frame.

Examples

# \donttest{
validated_data <- mamm_coords_validator (df = test_data_coordiantes, sp_names = "species")
#> 1 species found in the matrix and  1 is/are valid.
#> Validation Finished.
#> A total of 20 records were evaluated. The evaluation results are recorded in the "validation_result" column as follows:
#> - 0 = Valid species but records not registered within the analyzed boundaries.
#> - 1 = Valid species and coordinates according to official publications.
#> - 2 = Valid species and coordinates are registered in the ocean.
#> - 3 = Valid species and coordinates off the limits of the ocean administrative boundaries. We recommend reviewing the location manually.
#> - 4 = Not valid species. Not validated. Try `search_mammalcol()` to fix typos on species names.
# }