title: How to get the number of counts between two dates in R?
body: <p>I have the following data frame </p>
  
  <pre><code>df&lt;-data.frame(id=seq(from = 1, to=100), in= c("01-01-2020", "01-01-2020", "01-01-2020", "01-01-2020", "02-01-2020", "02-01-2020",  "02-01-2020", "02-01-2020"...), out=c("02-01-2020",  "20-01-2020", "02-05-2020", "02-04-2020", "02-03-2020"...)
  
  </code></pre>
  
  <p>I would like to get from that a dataframe which could tell how many unique ids are each day. 
  Something like this</p>
  
  <pre><code>df2&lt;-data.frame(day=c("01-01-2020", "02-01-2020", "03-01-2020", "04-01-2020"...), count = c(5,6,1,2,3...))
  
  </code></pre>
  
  <p>For example imagine we have just two id; id 1 date_in = "01-01-2020" and date out = "08-01-2020", and id 2 date_in = "05-01-2020" and date_out = "25-01-2020". Then the desired dataframe would be the following one:</p>
  
  <pre><code>df2= data.frame(day = c("01-01-2020", "02-01-2020", "03-01-2020", "04-01-2020", "05-01-2020", "06-01-2020", "07-01-2020", "08-01-2020", "09-01-2020", "10-01-2020"...), count = c(1,1,1,1,2,2,2,1,1,1,...))
  
  </code></pre>
  
  <p>As the id 1 would be the only one between 1-5 Jan the count would be 1, between 5-8 as id 1 and id 2 would be in the count would be 2, and after 8 Jan the count would be just 1 as just id 2 would be in.</p>