Message-ID: <1330618217473-4435408.post@n4.nabble.com>
Date: 2012-03-01T16:10:17Z
From: Rui Barradas
Subject: select rows by criteria
In-Reply-To: <1330615117432-4435257.post@n4.nabble.com>
Sorry, correction:
The second index matrix is the matrix of elements not in the first,
not another combination, this time 3 out of 10.
Change this in my first post
>
> inxmat <- with(DF, combn(ID, 3))
> meansDist2 <- apply(inxmat, 2, function(jnx) f(jnx, DF$value, 45))
> (i2 <- which(meansDist2 == min(meansDist2)))
>
to this
inxmat2 <- with(DF, apply(inxmat, 2, function(x) setdiff(ID, x)))
meansDist2 <- apply(inxmat2, 2, function(jnx) f(jnx, DF$value, 45))
(i2 <- which(meansDist2 == min(meansDist2)))
Rui Barradas
--
View this message in context: http://r.789695.n4.nabble.com/select-rows-by-criteria-tp4434812p4435408.html
Sent from the R help mailing list archive at Nabble.com.