R. , m, , , , data.frame. order , NA . R , -NA .
v <- m[order(row(m), is.na(m))]
dim(v) <- dim(m)
t(v)
## [,1] [,2] [,3] [,4]
## [1,] "a" "b" "c" NA
## [2,] "d" "e" NA NA
## [3,] "f" "g" "h" "i"
## [4,] "j" "k" "l" NA
, , , radix. , (?) 100 000 , :
v2 <- m[sort.list(is.na(m) + (row(m)-1L)*2L + 1L, method="radix")]