Worked with Kimberly Cobarruviaz. Interactive and static plots of Tourist Arrivals by Region from 2000 to 2018.
Start with the data
group_by
region so there will be a “river” for each region.
use e_charts
to create an e_chart
object with year on the x-axis.
use e_river
to build “rivers” that contain the amount of tourist arrivals. The depth of each river represents the amount of tourist arrivals for each region.
use e_tooltip
to add a tooltip that will display based on the x-axis values.
use e_title
to add a title, subtitle, and link to subtitle.
use e_theme
to change the theme to roma
.
regional_tourism %>%
group_by(Region) %>%
e_chart(x = Year) %>%
e_river(serie = `International Tourist Arrivals`, legend = FALSE) %>%
e_tooltip(trigger = "axis") %>%
e_title(text = "Annual Tourist Arrivals by Region", subtext = "Source: Our World in Data", sublink = "https://ourworldindata.org/grapher/international-tourist-arrivals-by-world-region", left = "center") %>%
e_theme("roma")
Start with the data.
use ggplot
to create a new ggplot object. Use aes
to indicate that Year
will be mapped to the x-axis, International Tourist Arrivals
will be mapped to the y-axis, and Region
will be the fill variable.
geom_area
will display the amount of tourist arrivals in that region.
theme_classic
sets the theme.
theme(legend.position = "bottom")
puts the legend at the bottom of the plot.
labs
sets the y-axis label, fill = NULL
indicates that the fill variable will not have the labelled region.
These plots show a steady increase in tourist arrivals since 2000. Tourist arrivals continue to increase.