base-apply function

Apply functions over time windows