R: Column and row-wise Any

Column and row-wise Any/All {Rfast} | R Documentation

## Column and row-wise Any

### Description

Column and row-wise Any/All of a matrix.

### Usage

    colAny(x)
    rowAny(x)
    colAll(x, parallel = FALSE)
    rowAll(x, parallel = FALSE)

### Arguments

`x` | A logical matrix with the data.
`parallel` | Do you want the computations to take place in parallel? The default value is FALSE.

### Details

The functions is written in C++ in order to be as fast as possible.

### Value

A vector where item "i" is true if found Any/All true in column/row "i". Otherwise false.

### Author(s)

R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.

### See Also

`Median, colMedians, colMeans (buit-in R function)`

### Examples

    x <- matrix(as.logical(rbinom(100*100,1,0.5)),100,100)
    system.time( a<-colAny(x) )
    system.time( b<-apply(x,2,any) )
    all.equal(a,b)

    system.time( a<-rowAny(x) )
    system.time( b<-apply(x,1,any) )
    all.equal(a,b)

    system.time( a<-colAll(x) )
    system.time( b<-apply(x,2,all) )
    all.equal(a,b)

    a<-b<-x<-NULL

[Package Rfast version 2.0.0 Index]