thank u very much you really helped me a lot. but those coding is from another people. now i imiate those coding,wirte such coding but it cannot work match_positions <- sapply(1:length(match_positions), function(j) {unlist(match_positions(j))[1]});