why not just refer to the index of the list/ column? In others words: test$id[3] <- 3 test$id[10] <- 6