Hello Nevil,
you could test something like:
# the Matrix
m = matrix(1:1000, ncol=10)
m = t(m)
# Extract Data
idcol = sample(seq(100), 100, TRUE); # now columns
for(i in 1:100) {
m2 = m[ , idcol];
}
m2 = t(m2); # transpose back
It may be faster, although I did not benchmark it.
There may be more complex variants. Maybe it is warranted to try for
10^7 extractions:
- e.g. extracting one row and replacing all occurrences of that row;
Sincerely,
Leonard
========
It seems I cannot extract digested mail anymore. I hope though that the
message is processed properly.
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.