I have a data frame with columns
full_name flag
XYZ yes
XYZ missing
XYZ yes
ABC yes
I first want to group by full_name, find the sum of flag values and then count no of 'yes' expected output -
full_name flag num den
XYZ yes 2 3
XYZ missing 2 3
XYZ yes 2 3
ABC yes 1 1
I have tried using summarize but it groups the names and gives the sum - I want the sum value to be added for each row. Any ideas? Thank you