R Markdown
timeline_data <- read.csv("https://gist.githubusercontent.com/martinjhnhadley/2cd4bb8ded9d69e32311fd26be9290b7/raw/3ba100dc0415c8e9222e1901a68cf0e8e164f329/dump.csv", stringsAsFactors = F)
timeline_data$Valid.from..b. <- as.Date(timeline_data$Valid.from..b.)
timeline_data$Valid.until..c... <- as.Date(timeline_data$Valid.until..c...)
library(ggplot2)
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:graphics':
##
## layout
ggplotly(ggplot(
timeline_data,
aes(
x = Valid.from..b.,
xend = Valid.until..c...,
y = Name.Policy,
yend = Name.Policy,
colour = Type.of.policy
)
) +
geom_segment(size = 4) +
geom_segment(
aes(
x = Valid.from..b. - 25,
xend = Valid.from..b.,
y = Name.Policy,
yend = Name.Policy
),
colour = "black",
size = 4,
arrow=arrow(type = "closed")
) +
xlab("Date") + ylab(""), tooltip = "text")