I have a data.frame that looks like this:
Sample_long_name Cluster Sample_shortname
S1_AAACCCAAGAGCCTGA 4 S1
S1_AAACCCAAGCTTAAGA 4 S1
S1_AAACCCACACGGCGTT 3 S1
S2_AAACCCACACTACCGG 3 S2
S3_AAACCCACAGCTGAGA 3 S3
S3_AAACCCACATAGATGA 1 S3
I would like the following output:
Sample_long_name Cluster Sample_shortname
S1_AAACCCAAGAGCCTGA 4 Cl4_cell1
S1_AAACCCAAGCTTAAGA 4 Cl4_cell2
S1_AAACCCACACGGCGTT 3 Cl3_cell1
S2_AAACCCACACTACCGG 3 Cl3_cell2
S3_AAACCCACAGCTGAGA 3 Cl3_cell3
S3_AAACCCACATAGATGA 1 Cl1_cell1
.......................
In other words, based on the number of the cluster I would like to enumerate the cells. The ordering in the first column does not matter. In total I have 30.000 cells for around 12 clusters.