Hi, how can I group my table by a certain column and then add the total count and then add another column using mutate function in which added column needs to have a count if a condition is met?
Below is my starting point but not working!!
df1 <- df %>% group_by(ticker,company) %>%
summarize(count = n()) #%>%
#ungroup() %>% mutate(count4 = sum(df$EPS == "4")