Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Date Week Spend
- 1 2019-07-14 2019-07-08 1.81
- 2 2019-07-13 2019-07-08 1.31
- 3 2019-07-12 2019-07-08 1.56
- 4 2019-07-11 2019-07-08 0.45
- 5 2019-07-10 2019-07-08 5.00
- df$nweek = (rep(1:15, each= 7))
- Date Week Spend nweek
- 1 2019-07-14 2019-07-08 1.81 1
- 2 2019-07-13 2019-07-08 1.31 1
- 3 2019-07-12 2019-07-08 1.56 1
- 4 2019-07-11 2019-07-08 0.45 1
- 5 2019-07-10 2019-07-08 5.95 1
- 6 2019-07-09 2019-07-08 3.59 1
- 7 2019-07-08 2019-07-08 4.08 1
- 8 2019-07-07 2019-07-01 2.83 2
- 9 2019-07-06 2019-07-01 1.38 2
- 10 2019-07-05 2019-07-01 1.59 2
- 11 2019-07-04 2019-07-01 0.93 2
- 12 2019-07-03 2019-07-01 1.50 2
- 13 2019-07-02 2019-07-01 3.22 2
- 14 2019-07-01 2019-07-01 6.20 2
- 15 2019-06-30 2019-06-24 5.47 3
- 16 2019-06-29 2019-06-24 1.77 3
- df = df %>% group_by(nweek) %>%
- summarise (Spend = sum(Spend))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement