[R] Successively eliminating most frequent elemets

2007-08-08 Thread Balazs Torma
Dear experts, I have a 10x2 matrix T containing random integers. I would like to delete pairs (rows) iteratively, which contain the most frequent element either in the first or second column: T - matrix(trunc(runif(20)*10), nrow=10, ncol=2) G - matrix(0, nrow=6, ncol=2) for (i in

Re: [R] filling a list faster

2007-07-13 Thread Balazs Torma
) ) ) ) ) ( ( ( ( (Numerical Ecology of Aquatic Systems ) ) ) ) ) Mons-Hainaut University, Belgium ( ( ( ( ( .. Balazs Torma wrote: hello, first I create a list: l - list(1-c(1,2,3)) then I run the following cycle, it takes over a minute

[R] filling a list faster

2007-07-13 Thread Balazs Torma
are calculated iteratively in an algorithm) Are there any packages and documents on how to use more advanced and fast data structures like linked-lists, hash-tables or trees for example? Thank you, Balazs Torma __ R-help@stat.math.ethz.ch mailing list

[R] counting occurances of matching rows in a matrix

2007-07-13 Thread Balazs Torma
consider each row as one data point, and not all elements in the matrix separately: as.data.frame(table(M)) M Freq 1 12 2 22 3 31 4 41 Any help greatly appreciated! Balazs Torma __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch

[R] matrix of bins with different length

2007-07-10 Thread Balazs Torma
the vectors (containers) in the matrix are usually of different length. Any help greatly appreciated, Balazs Torma __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org