original data
(ID) [category] {name}
(1) [1] {Tom}
(2) [1] {Jane}
(3) [3] {Kate}
(4) [1] {Ted}
(5) [3] {Mary}
(6) [6] {John}
(7) [6] {Juno}
(8) [8] {Emily}
(9) [6] {Ross}
I have the above data in myTable.
I can group the above data by min(category) as min_category .
It will produce
group by category
(1) [1] {Tom}
(3) [3] {Kate}
(6) [6] {John}
(8) [8} {Emily}
Now I'll tell you what I want.
I like to update all the name values in a same group with the group representitive value.
target data
(ID) [category] {name}
(1) [1] {Tom}
(2) [1] {TOM}
(3) [3] {Kate}
(4) [1] {TOM}
(5) [3] {KATE}
(6) [6] {John}
(7) [6] {JOHN}
(8) [8] {Emily}
(9) [6] {JOHN}
How can I make the target data from the original data?
Thanks in Advance