df <- as.data.frame(rbind(c("12,15,19,15,12,16,41"),c("1,2,3,4,5,4,3,2,1")))
x <- apply(df, 1, function(x) eval(parse(text=paste0("c(", x, ")"))) )
sapply(x, function(x) as.numeric(unique(x)))
возвращает
[,1] [,2]
[1,] 12 1
[2,] 15 2
[3,] 19 3
[4,] 16 4
[5,] 41 5