I am trying to generate a series by summing the next 3 values and next 4 values to calculate the forcast_leadtime and forecast weeks of supply in R. in the first row i have populated the expected values for both which is 1.008 & 1.64 respectively. Could you advise how to generate this running series in R. Thank you
forecast_leadtime(FL) = Sum of SYS_FORC for Weeks 2,3 4 forecast_weeks of supply(FWOS) = Sum of SYS_FORC for Weeks 5,6,7,8
SKU STORE_CD FWK_CD WK_Sequence_NBR SYS_FORC FL FWOS 12345 10 201648 935 0.328 1.008 1.64 12345 10 201649 936 0.326 0 0 12345 10 201650 937 0.323 0 0 12345 10 201651 938 0.359 0 0 12345 10 201652 939 0.366 0 0 12345 10 201701 940 0.414 0 0 12345 10 201702 941 0.433 0 0 12345 10 201703 942 0.4enter image description here27 0 0 12345 10 201704 943 0.421 0 0 12345 10 201705 944 0.422 0 0