Tuesday 10 April 2012

how to use empty 'which()' results in R?

As the function returns a vector, for the cases in which the function does not find any cases matching the criteria it will return a vector length of zero

> length(which(borders$end == bands[b,'start']))
[1] 0