A horizon graph is an analytical graphical method specially designed for visualising large numbers of time-series. It aims to overcome the issue of visualising highly overlapping time-series as shown in the figure below.
A horizon graph essentially an area chart that has been split into slices and the slices then layered on top of one another with the areas representing the highest (absolute) values on top. Each slice has a greater intensity of colour based on the absolute value it represents.
Before getting started, please visit Getting Started to learn more about the functions of ggHoriPlot package. Next, read geom_horizon() to learn more about the usage of its arguments.
20.2 Getting started
Before getting start, make sure that ggHoriPlot has been included in the pacman::p_load(...) statement above.
Show the code
pacman::p_load(ggHoriPlot, ggthemes, tidyverse)
package 'ggHoriPlot' successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\tskam\AppData\Local\Temp\Rtmpiqnh9L\downloaded_packages
package 'ggthemes' successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\tskam\AppData\Local\Temp\Rtmpiqnh9L\downloaded_packages
By default, read_csv will import data in Date field as Character data type. dmy() of lubridate package to palse the Date field into appropriate Date data type in R.
20.2.2 Step 2: Plotting the horizon graph
Next, the code chunk below will be used to plot the horizon graph.