equivalent to rollsum(x, k=G, fill=NA, align="left") in the package zoo, but optimized for speed
rolling_sum(x, G)
Useful links