I have two data frames containg string names with a specific condition and a numeric index value. What I want is to count how many names are there for a condition using an index value as reference.
The data frame is big so I'll just put and example.
I want to summarize all values in NAME from a taking into account CONDITION between INDEX-MIN and INDEX-MAX from b. Here it its important to specify that not all names in ´a´ will be captured or summarize in the final result.
The result should be as shown in c
a <- data.frame(c(1,1,2,3,3,3),c("A","B","C","D","E","F"),c(100,500,233,74,2750,10043))
colnames(a) <- c("CONDITION","NAME","INDEX")
b <- data.frame(c(1,2,3,3),c(1,75,2700,9872),c(600,245,3500,10500))
colnames(b) <- c("CONDITION","INDEX-MIN","INDEX-MAX")
c <- data.frame(c(1,2,3,3),c(1,75,2700,9872),c(600,245,3500,10500),c(2,1,1,1),c("A, B","C", "E", "F"))
colnames(c) <- c("CONDITION","INDEX-MIN","INDEX-MAX","NAME-COUNT","NAME")