Created
September 12, 2018 19:06
-
-
Save chadsten/55d0b55171bf3019e2c4714646156cc3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# compile Q1 data | |
q1_data <- weight_hits(IR, 0, 3, 1) | |
weight_hits <- function(data, start, end, weight) { | |
result <- filter(IR, OrderDate < Sys.Date() - months(start), OrderDate >= Sys.Date() - months(end)) %>% | |
group_by(PartNum, Plant) %>% | |
summarise(hits = n() * weight) | |
return(result) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment