Closed hope-data-science closed 4 years ago
@mitchelloharawild Maybe we could add time-direction arrows to gg_lagplot() in feasts?
Do you mean like so?
library(feasts)
#> Loading required package: fabletools
library(tsibble)
library(dplyr)
tsibbledata::aus_retail %>%
filter(
State == "Victoria",
Industry == "Cafes, restaurants and catering services"
) %>%
gg_lag(Turnover, arrow = grid::arrow(length = grid::unit(2, "mm")))
Created on 2019-10-17 by the reprex package (v0.2.1)
Yes. What do you think of adding arrow=TRUE as an argument in gg_lag?
I think arrow
should continue to be passed to geom_line()
so that the angle and size of the arrow head can be specified.
We can explain in the docs how arrows can be added, or we can also provide some other argument to create default arrows, such as direction
or directional
.
Although I presume there is a reason for why ggplot2 doesn't provide a convenient basic arrow when arrow=TRUE
, so maybe there is an argument against having the direction
shortcut.
Excellent! Another thing might be that, how could we explain the direction properly in practice. When I know the track is continious I think an arrow might help, but what informative knowledge might it provide? Any ideas?
As a lag plot shows the series values on the x axis with lagged values on the y axis, the arrows in the plot above indicate an upward trend. If the arrows were pointing in the other direction, the data contains a negative trend.
A direction might also tell us when the series is coming near to the isoline, don't know if I'm right on this.
Gglagplot is a good displayment for lag plots, however, I could hardly find the direction of change. Therefore, I suggest adding an arrow to show the direction of change.