unwrapdups(M,ndups=2,spacing=1)
ndups
.M
corresponding to duplicate spots, spacing=1
for consecutive spotsM
but with fewer rows and more columns by a factor of ndups
.
Each set of ndups
rows in M
is strung out to a single row so that duplicate values originally in consecutive rows in the same column are in consecutive columns in the output.M <- matrix(1:12,6,2)
unwrapdups(M,ndups=2)
unwrapdups(M,ndups=3)
unwrapdups(M,ndups=2,spacing=3)
Run the code above in your browser using DataLab