I have a dataset with many columns but I will only mention the ones that are necessary for this operation and provide a provisional one (I also believe you do not need the ID information I just included it to make it easier to comprehend).
Business Division | Local Claim ID| CMB
GC 123 **Y**
GC 124 N
NAC 125 N
NAC 126 N
NAC 127 **Y**
GC 128 N
and I would like to get rid of the CMB column while I would replace the CMB value for each business division if the original value is Y, basically I would want the table to look like following: (Business Divison now 3 classes)
Business Division | Local Claim ID
**CMB** 123
GC 124
NAC 125
NAC 126
**CMB** 127
GC 128
Here is the output of dput
to reproduce my data:
structure(list(Business.Division = c("CMB", "GC", "NAC", "NAC",
"CMB", "GC"), Local.Claim.ID = 123:128, CMB = c("Y", "N",
"N", "N", "Y", "N")), .Names = c("Business.Division", "Local.Claim.ID",
"CMB"), row.names = c(NA, -6L), class = "data.frame")