Reads, processes, and merges the core components of the Catálogo Taxonômico da Fauna do Brasil

merge_data(
  path_data,
  version_data,
  solve_discrepancies = TRUE,
  translate = TRUE,
  encoding = "UTF-8",
  verbose = TRUE
)

Arguments

path_data

(character) the base directory path where the downloaded data is stored.

version_data

(numeric) version of the Fauna do Brasil database downloaded.

solve_discrepancies

(logical) wheter to resolve inconsistencies between species and subspecies information. When set to TRUE (default), species information is updated based on unique data from subspecies. For example, if a subspecies occurs in a certain state, it implies that the species also occurs in that state.

translate

(logical) whether to translate the original dataset ("lifeForm", "origin", "habitat", and "taxonRank") from Portuguese to English. Default is TRUE.

encoding

(character) The text string encoding to pass down to data.table::fread(). Default is "UTF-8".

verbose

(logical) whether to display messages during function execution. Set to TRUE to enable display, or FALSE to run silently. Default is TRUE.

Value

The final dataset is built dynamically and saved directly to the matching data directory as a compressed Gzip file named "CompleteBrazilianFauna.gz".

Examples

if (FALSE) { # \dontrun{
merge_data(path_data = "data", version_data = "latest",
            solve_discrepancies = TRUE, translate = FALSE, verbose = TRUE)
} # }