Is there a way to identify (for subsequent replacement) which rows in a
matrix are comprised entirely of *integers*? I have a large set of
*nx3 *matrices
where each row either consists of a set of 3 integers or a set of 3 real
numbers. A given matrix might looks something like this:
Le 10/08/10 10:05, David Katz a écrit :
Is there a way to identify (for subsequent replacement) which rows in a
matrix are comprised entirely of *integers*? I have a large set of
*nx3 *matrices
where each row either consists of a set of 3 integers or a set of 3 real
numbers. A given matrix
On Aug 10, 2010, at 10:13 AM, Romain Francois wrote:
rowSums( x == round(x) ) == ncol(x)
[1] TRUE FALSE TRUE FALSE
For later readability, I think I'd prefer
apply(x==round(x), 1, all)
--
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000
3 matches
Mail list logo