A one-dimensional delete might be faster:
n - 4000
m - 0.01
matr - matrix(1:(n^2), n, n)
excl_r - sample(n, m*n)
incl_r - setdiff(1:n, excl_r)
excl_c - sample(n, m*n)
incl_c - setdiff(1:n, excl_c)
system.time(matr[-excl_r, -excl_c])
system.time(
{ m4 - matr[outer(incl_r, incl_c, function(i, j) i
I mean something like in MATLAB matrix(sel_r,:)=[]
jastar wrote:
Hi,
I'm working with a big square matrix (15k x 15k) and I have some trouble.
I want to delete selecting rows and columns.
I'm using something like this:
sel_r=c(15,34,384,985,4302,6213)
Hi,
I'm working with a big square matrix (15k x 15k) and I have some trouble.
I want to deleting selecting rows and columns.
I use something like this:
sel_r=c(15,34,384,985,4302,6213)
sel_c=c(3,151,324,3384,7985,14302)
matrix=matrix[-sel_r,-sel_c]
but it works very slow.
Does anybody know