Based on your comments, you wish to obtain a semi-colon separated list of unique values in the gene column. You can create a new column containing these using: ```r xyz <- data.frame(chr="chr1", gene = c("RUNX3;RUNX3", "RUNX3;RUNX3", "SFN", "NR0B2", "NR0B2", "TFAP2E", "A;B;A")) xyz chr gene 1 chr1 RUNX3;RUNX3 2 chr1 RUNX3;RUNX3 3 chr1 SFN 4 chr1 NR0B2 5 chr1 NR0B2 6 chr1 TFAP2E 7 chr1 A;B;A xyz$gene_uniq <- sapply(xyz$gene, function(x) paste(unique(unlist(strsplit(x, ";"))), collapse=";")) xyz chr gene gene_uniq 1 chr1 RUNX3;RUNX3 RUNX3 2 chr1 RUNX3;RUNX3 RUNX3 3 chr1 SFN SFN 4 chr1 NR0B2 NR0B2 5 chr1 NR0B2 NR0B2 6 chr1 TFAP2E TFAP2E 7 chr1 A;B;A A;B ``` Or you can use dplyr. I'll edit and paste an example below.