View source: R/get_brazil_vehicle_brands.R
get_brazil_vehicle_brands | R Documentation |
This function retrieves a list of vehicle brands in Brazil using the BrasilAPI endpoint, which provides data sourced from FIPE (Fundação Instituto de Pesquisas Econômicas). The user must specify the type of vehicle: '"carros"', '"motos"', or '"caminhoes"'.
get_brazil_vehicle_brands(tipo_veiculo)
tipo_veiculo |
A string indicating the type of vehicle. Must be one of '"carros"', '"motos"', or '"caminhoes"'. |
This function sends a GET request to the BrasilAPI endpoint and parses the list of vehicle brands.
If the API returns an error (e.g., invalid vehicle type), the function will return NULL
.
A tibble (data frame) with the following columns:
nome
: Brand name.
valor
: FIPE code of the brand.
Requires internet connection. Only supports Brazilian vehicle types defined by BrasilAPI.
GET
, fromJSON
, as_tibble
## Not run:
# Retrieve list of car brands
cars <- get_brazil_vehicle_brands("carros")
head(cars)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.