Learn R Programming

faunabr (version 1.0.0)

translate_faunabr: Translate information in Brazilian Fauna database

Description

This function translates information in the "lifeForm", "origin", "habitat", "taxonRank", and "taxonomicStatus" columns between Portuguese and English.

Usage

translate_faunabr(data, map_list = NULL, to = "en")

Value

A data.frame with the values in the "lifeForm", "origin", "habitat", "taxonRank", and "taxonomicStatus" columns translated.

Arguments

data

(data.frame) the data.frame imported with the load_faunabr function.

map_list

(list) A list of data.frames used for translation. The default is NULL, which means it uses faunabr::map_translation. If not NULL, its structure (list names and data.frame column names) must be identical to faunabr::map_translation.

to

(character) The target language for translation. Available options are "en" to translate from Portuguese to English, and "pt_br" to translate from English to Portuguese. The default is "en".

Examples

Run this code
data("fauna_data") #Load data example (in English)
#Translate to Portuguese
fauna_portugues <- translate_faunabr(data = fauna_data, to = "pt_br")
# See attributes of lifeForm in Portuguese
fauna_attributes(fauna_portugues, attribute = "lifeForm")

Run the code above in your browser using DataLab