Plot a WDI indicator as an interactive bar-plot (powered by plotly)

plot_bar_wdi(
  indicator = "NY.GDP.PCAP.KD",
  highlight_countries = c("Colombia", "Germany"),
  start = lubridate::year(Sys.Date()) - 10,
  end = lubridate::year(Sys.Date() - months(18)),
  country = "all",
  regions = default_regions(),
  income_groups = default_income_groups(),
  base_color = "skyblue",
  highlight_color = "red"
)

Arguments

indicator

character of length 1 with the indicator code

highlight_countries

character vector with country names to highlight

start

first year to download data

end

last year to download data

country

subset of countries to download data from. Default to "all". This argument is passed as is to WDI::WDI and hence, requires 'ISO-2 character codes, e.g. "BR", "US", "CA"'.

regions

character vector to filter the data only to specific regions

income_groups

character vector to filter the data only to specific income groups

base_color

fill color for the bars for most countries

highlight_color

fill color for the bars for highlighted countries

Value

a plotly object

Examples

if (FALSE) {
plot_bar_wdi()
}