Displaying 1 result from an estimated 1 matches for "min_month".
2011 Apr 16
1
Matching Problem: Want to match to data.frame with inexact matching identifier (one identifier has to be in the range of the other).
...rs, which means that one
quarter is not necessarily 3 month long
d2 <- data.frame(cbind(c("A","A","B","B"),c(1,3,1,4),c(2,5,3,5),c("v1","v2","v3","V4")),stringsAsFactors=FALSE)
names(d2) <- c("ID", "Min_Month", "Max_Month","Value")
d2[,"Min_Month"] <- as.integer(d2[,"Min_Month"])
d2[,"Max_Month"] <- as.integer(d2[,"Max_Month"])
#Possible solution: Loop through every company and month and check in
which quarter (based on Min_Month an...