R/quickplots.R
plot_bar_wdi.Rd
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"
)
character of length 1 with the indicator code
character vector with country names to highlight
first year to download data
last year to download data
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"'.
character vector to filter the data only to specific regions
character vector to filter the data only to specific income groups
fill color for the bars for most countries
fill color for the bars for highlighted countries
a plotly object
if (FALSE) {
plot_bar_wdi()
}