0

I have this function that counts all instances in 1 day(12am to 12am) i want it to count all instances from 12pm to 12pm :

days_analyzed_data <- data%>% #(Liat`s code with a change for day instead of minute)
    filter(PERCENTAGE != "100.00%") %>%
    mutate(TIME = dmy_hms(TIME, tz = "Asia/Jerusalem")) %>% 
    mutate(DATE = date(TIME),
           TIME = as_hms(floor_date(TIME, unite="1 day"))) %>% #here is where u choose minute/hour/day.. etc'
    group_by(CAMERA, DATE, TIME) %>%
    summarise(count = n())

TNKS

Pr.Args
  • 1
  • 1
  • 3
    Welcome to SO, Pr.Args! Questions are much easier to answer when we have sample data to work with. Please read https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info about ways to provide a good *sample* of just-enough data to work with (hint: `dput(.)` or `read.table(text=.)`). Thanks! – r2evans Jan 06 '22 at 22:06
  • We can't test this or come up with a solution without example data, but it sort of sounds that you just use `if_else` to add 1 to `DATE` if `TIME` is after noon. – divibisan Jan 14 '22 at 15:37
  • e.g. use dput(data) or if it's to big dput(head(data)) to create a reproducible example by giving an example of how your data.frame looks like – JKupzig Jan 14 '22 at 16:34

0 Answers0