[Solved] Find new and active user each week from user_id and date


so I managed to calculate the count_new by checking the first appearance of a user_id
and then merging with initial data adding a column that tell if a user is new by date and id then I counted the new by date:

library(dplyr)
firstshow<-Orders %>%
group_by(user_id) %>%
  arrange(date) %>%
  slice(1L) %>%
  mutate(new = "new")

newdata<-merge.data.frame(Orders,firstshow,by=c("date","user_id"),all = T)
count<-newdata %>%
  filter(new=="new" ) %>%
  group_by(date) %>%
 tally()
names(count)[2]<-"count_new" 

solved Find new and active user each week from user_id and date