Here's another option for calculating and plotting quantiles.
library(tidyverse)
# Fake data
set.seed(2)
d = replicate(1000, data.frame(year=2000:2018, value=cumsum(rnorm(19))), simplify=FALSE) %>%
bind_rows(.id="location")
# Summarise to get quantiles by year
prob=seq(0,1,0.1)
ds = d %>% group_by(year) %>%
summarise(lab = list(paste0(prob*100, "%")),
q = list(quantile(value, prob))) %>%
unnest
ggplot(ds, aes(year, q, colour=lab)) +
geom_line() +
geom_text(data=ds %>% filter(year==max(year)), aes(label=lab, x=max(ds$year)),
position=position_nudge(x=0.2), hjust=0, size=3) +
theme_classic() +
guides(colour=FALSE) +
expand_limits(x=2018.6)
