R/translate_faunabr.R
translate_faunabr.Rd
This function translates information in the "lifeForm", "origin", "habitat", "taxonRank", and "taxonomicStatus" columns between Portuguese and English.
translate_faunabr(data, map_list = NULL, to = "en")
(data.frame) the data.frame imported with the
load_faunabr
function.
(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
.
(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".
A data.frame with the values in the "lifeForm", "origin", "habitat", "taxonRank", and "taxonomicStatus" columns translated.
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")
#> $lifeForm
#> lifeForm
#> 1 colonial
#> 2 comensal
#> 3 ectoparasito
#> 4 herbivoro
#> 5 polinizador
#> 6 predador
#> 7 sessil
#> 8 vida_livre_individual
#>