This is my dataset:
set.seed(327)
ID <- seq(1:50)
mou <- sample(c(2000, 2500, 440, 4990, 23000, 450, 3412, 4958, 745, 1000),
50, replace=TRUE)
calls <- sample(c(50, 51, 12, 60, 90, 16, 89, 59, 33, 23, 50, 555),
50, replace=TRUE)
rev <- sample(c(100, 345, 758, 44, 58, 334, 888, 205, 940, 298, 754),
50, replace=TRUE)
dt <- data.frame(mou, calls, rev)
My motive is to find the mean of mou
where calls is greater than 34 and less than 200 and rev
greater than 100 and less than 400.
I started approaching this problem by using dplyr but I am not so sure how to correctly use the desired expression inside filter function.
dt %>% filter(???) %>% summarize(mean_mou=mean(mou))
Could you please guide how to frame this expression inside filter correctly.