magrittr
does exist for R 3.6 (hard to know what the real problem is, because of lack of information) but this part of the code
Is equivalent to this, without using magrittr
(kind of, since part of it is already imported by dplyr
)
df <- df %>% mutate(lagsales = lag(sales))