I want to find the unique entries for ID1 and ID2 so if a "aaf" entered the data in id1 and id2 the if will be single entry so here unique entries will 8 from id1 and id2 . i want to assing unique entries in separate variable . you can refer the pic below
then i want to bind the columns one by another like the pic below. final db should be look like binding rows
df <- structure(list(city=c("del","mum","nav","pun","bang","chen","triv","vish","del"),
name= c("xab","Lan","mun","mmc","aaf","nnhu","njam","jiha","ntha"),
`ID 1` = c(653, NA, 240, NA, 826, NA, NA, 440,
385), `ID 2` = c(NA, 610, NA, 240, 551, 854, NA, 490, 653),
`S1`=c(213, 233, NA, NA, 333, 543, 122, NA, 765),
`S1`=c(176, NA, NA, 100, 124, 621, NA, 434, 323)), row.names = c(NA,
-9L), class = "data.frame")
i want the output should look like below, i dont want this column with 8