# Run examples only if a connection to the API is available:
if (check_countries_api(warnings = FALSE)){
# The example below queries information on the currency used in Brazil, US and France:
info <- country_info(countries = "Brazil", fields = "capital")
# data for multiple countries can be requested
info <- country_info(countries = c("Brazil", "USA", "FR"), fields = "capital")
#' # Data can be returned for all countries by leaving - countries - empty
info <- country_info(fields = "capital")
# All available fields can be requested by leaving fields empty
info <- country_info(countries = c("Brazil", "USA", "FR"))
# All information for all countries can be downloaded by leaving both arguments empty
info <- country_info()
}
Run the code above in your browser using DataLab