Learn R Programming

glossa (version 1.0.0)

read_presences_absences_csv: Read and validate presences/absences CSV file

Description

This function reads and validates a CSV file containing presences and absences data for species occurrences. It checks if the file has the expected columns and formats.

Usage

read_presences_absences_csv(
  file_path,
  file_name = NULL,
  show_modal = FALSE,
  coords = c("decimalLongitude", "decimalLatitude"),
  sep = "\t",
  dec = "."
)

Value

A data frame with the validated data if the file has the expected columns and formats, NULL otherwise.

Arguments

file_path

The file path to the CSV file.

file_name

Optional. The name of the file. If not provided, the base name of the file path is used.

show_modal

Optional. Logical. Whether to show a modal notification for warnings (use in Shiny). Default is FALSE.

coords

Optional. Character vector of length 2 specifying the names of the columns containing the longitude and latitude coordinates. Default is c("decimalLongitude", "decimalLatitude").

sep

Optional. The field separator character. Default is tab-separated.

dec

Optional. The decimal point character. Default is ".".