I have following data frame:
KEY PROD PARAMETER Y/N
1 AAA PARAM1 Y
1 AAA PARAM2 N
1 AAA PARAM3 N
2 AAA PARAM1 N
2 AAA PARAM2 Y
2 AAA PARAM3 Y
3 CCC PARAM1 Y
3 CCC PARAM2 Y
3 CCC PARAM3 Y
I am interested in summarizing Y/N column values by PROD and PARAMETER columns and get the following output:
PROD PARAM Y N
AAA PARAM1 1 1
AAA PARAM2 1 1
AAA PARAM3 1 1
CCC PARAM1 1 0
CCC PARAM2 1 0
CCC PARAM3 1 0
While Y and N values are counts of Y/N column values from the original data frame.