powered by
create matrix indices from row and columns positions
matcomb(r, c)
integer vector of row positions
integer vector of column positions
a k by 2 matrix of matrix indices where k = length(r) * length(c)
k = length(r) * length(c)
rows rotate faster than columns
row, col , expand.grid
row
col
expand.grid
# NOT RUN { matcomb(1:3, 1:4) matcomb(2:3, 2:4) # }
Run the code above in your browser using DataLab