'After comparing two columns, how can I remove unique values in one column with its values in other different columns in R

I have 3 columns in an excel file. Note: my DCL anc CL columns are not the same lenght. I have extra values in CL and also my values in CL have numeric values in ic50. Exactly I remove both those extra values which are in CL and ic50. (DCL, CL and ic50 are my columns' names)

DCL         CL          ic50
COLO-684    COLO-684    1,853021
COLO-792    COLO-792    1,673109
COLO-824    COLO-824    24,194019
COLO-829    COLO-829    125,288504
COR-L105    COR-L105    1,324301
COR-L23     COR-L23     13,645992
CPC-N       COR-L311    3,807295
CTV-1       CP66-MEL    7,974192
CW-2        CPC-N       4,701374
D-263MG     CTV-1       0,252652
D-283MED    CW-2        6,857369
            D-263MG     17,863089
            D-283MED    0,279165

I want to remove unique values in colum CL with its values of column ic50. Finally, I want to have the values in both in DCL and CL with the numeric values of CL in ic50. So, I will have the same length in all columns.

Expected file:

DCL         CL          ic50
COLO-684    COLO-684    1,853021
COLO-792    COLO-792    1,673109
COLO-824    COLO-824    24,194019
COLO-829    COLO-829    125,288504
COR-L105    COR-L105    1,324301
COR-L23     COR-L23     13,645992
CPC-N       CPC-N       4,701374
CTV-1       CTV-1       0,252652
CW-2        CW-2        6,857369
D-263MG     D-263MG     17,863089
D-283MED    D-283MED    0,279165
r


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source