The source of the data used in these graphs originates from a 2005 paper titled Oscillatory modes of extended Nile River records (A.D. 622–1922) authors D. Kondrashov, Y. Feliks, and M. Ghil. The paper is found at this link https://doi.org/10.1029/2004GL022156

Nile <- read.csv("Nile.csv")
Nile[, 2:4][Nile[, 2:4] == 0] <- NA
NileLow <- Nile$Low.Flow
NileHigh <- Nile$High.Flow
Diff <- mutate(Nile, Diff2 = NileHigh - NileLow)
Diff <- Diff$Diff2
NileLow %>% ts(freq=1,start=622) -> NileLow_ts
NileHigh %>% ts(freq=1,start=622) -> NileHigh_ts
Diff %>% ts(freq=1,start=622) -> Diff_ts

Nile Low Flow

NileLow_ts %>% dygraph(width=775,height=400, main = "Plot of Low Flow in the Nile (622-1921)", xlab = "Years 622-1921", ylab = "Measurement of the River Nile") %>% dyRangeSelector

Nile High Flow

NileHigh_ts %>% dygraph(width=775,height=400, main = "Plot of High Flow in the Nile (622-1921)", xlab = "Years 622-1921", ylab = "Measurement of the River Nile") %>% dyRangeSelector

Difference between high and low flow

Diff_ts %>% dygraph(width=775,height=400, main = "Plot of difference between high and low flow in the Nile (622-1921)", xlab = "Years 622-1921", ylab = "Measurement of the River Nile") %>% dyRangeSelector

Nile High & Low Combined

Nile_ts <- cbind(NileLow_ts, NileHigh_ts)
Nile_ts %>% dygraph(width=775,height=500, main = "Plot of High & Low Flow in the Nile (622-1921)", xlab = "Years 622-1921", ylab = "Measurement of the River Nile") %>% dyRangeSelector

Nile High, Low & Difference Combined

Nile_ts <- cbind(NileLow_ts, NileHigh_ts, Diff_ts)
Nile_ts %>% dygraph(width=775,height=500, main = "Plot of High, Low and difference in flow in the Nile (622-1921)", xlab = "Years 622-1921", ylab = "Measurement of the River Nile") %>% dyRangeSelector
plot_ly(data = Nile) -> base
base %>%
  add_trace(x=Nile$Years, y=Nile$Low.Flow, type = 'scatter', mode = 'lines', line=list(color="green"), name='Low') %>%
  add_trace(x=Nile$Years, y=Nile$Diff_Flow, type = 'scatter', mode = 'lines', line=list(color="darkblue"), name='Diff') %>%
  add_trace(x=Nile$Years, y=Nile$High.Flow, type = 'scatter', mode = 'lines', line=list(color="purple"), name='High') %>%
  layout(title='Nile Flow Comparison', yaxis=list(title='Nile Flow', tickangle=-90, showline=TRUE)) -> comparison
comparison
base %>% 
  add_trace(x=Nile$Years, y=Nile$Low.Flow,
            type='scatter', mode = 'lines', line=list(color="green"), name='Low') -> Low_sp
base %>% 
  add_trace(x=Nile$Years, y=Nile$Diff_Flow,
            type='scatter',mode = 'lines', line=list(color="darkblue"), name='Diff') -> Diff_sp
base %>% 
  add_trace(x=Nile$Years, y=Nile$High.Flow,
            type='scatter', mode = 'lines', line=list(color="purple"), name='High') -> High_sp
subplot(Low_sp, Diff_sp, High_sp, nrows = 3) %>%
  layout(title="Nile Flow Comparison", yaxis=list(title="Nile Flow")) -> sub2
sub2