Re: [R] Proportion of equal entries in dist()?

2015-01-20 Thread Bert Gunter
... (just a comment) and since this appears to be O(m^2 x n), where m,n are the number of rows and columns (correction requested if I got this wrong), it would appear that some basically C level functionality -- perhaps the one Jean suggested? -- would be required for even moderately large

Re: [R] Proportion of equal entries in dist()?

2015-01-20 Thread Adams, Jean
Jorge, I have not used it myself, but you might find the dist() function in the proxy package to be useful. http://cran.r-project.org/web/packages/proxy/index.html Jean On Mon, Jan 19, 2015 at 7:38 AM, Jorge I Velez jorgeivanve...@gmail.com wrote: Dear all, Given vectors x and y, I would

Re: [R] Proportion of equal entries in dist()?

2015-01-20 Thread Henrik Bengtsson
On Mon, Jan 19, 2015 at 5:38 AM, Jorge I Velez jorgeivanve...@gmail.com wrote: Dear all, Given vectors x and y, I would like to compute the proportion of entries that are equal, that is, mean(x == y). Now, suppose I have the following matrix: n - 1e2 m - 1e4 X - matrix(sample(0:2, m*n,

[R] Proportion of equal entries in dist()?

2015-01-19 Thread Jorge I Velez
Dear all, Given vectors x and y, I would like to compute the proportion of entries that are equal, that is, mean(x == y). Now, suppose I have the following matrix: n - 1e2 m - 1e4 X - matrix(sample(0:2, m*n, replace = TRUE), ncol = m) I am interested in calculating the above proportion for