Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. Date Week Spend
  2. 1 2019-07-14 2019-07-08 1.81
  3. 2 2019-07-13 2019-07-08 1.31
  4. 3 2019-07-12 2019-07-08 1.56
  5. 4 2019-07-11 2019-07-08 0.45
  6. 5 2019-07-10 2019-07-08 5.00
  7.  
  8. df$nweek = (rep(1:15, each= 7))
  9.  
  10. Date Week Spend nweek
  11. 1 2019-07-14 2019-07-08 1.81 1
  12. 2 2019-07-13 2019-07-08 1.31 1
  13. 3 2019-07-12 2019-07-08 1.56 1
  14. 4 2019-07-11 2019-07-08 0.45 1
  15. 5 2019-07-10 2019-07-08 5.95 1
  16. 6 2019-07-09 2019-07-08 3.59 1
  17. 7 2019-07-08 2019-07-08 4.08 1
  18. 8 2019-07-07 2019-07-01 2.83 2
  19. 9 2019-07-06 2019-07-01 1.38 2
  20. 10 2019-07-05 2019-07-01 1.59 2
  21. 11 2019-07-04 2019-07-01 0.93 2
  22. 12 2019-07-03 2019-07-01 1.50 2
  23. 13 2019-07-02 2019-07-01 3.22 2
  24. 14 2019-07-01 2019-07-01 6.20 2
  25. 15 2019-06-30 2019-06-24 5.47 3
  26. 16 2019-06-29 2019-06-24 1.77 3
  27.  
  28. df = df %>% group_by(nweek) %>%
  29. summarise (Spend = sum(Spend))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement