Skip to content
Prev 258314 / 398502 Next

Subsetting Data

On Apr 28, 2011, at 3:38 PM, David Winsemius wrote:

            
> NROW
function (x)
if (is.array(x) || is.data.frame(x)) nrow(x) else length(x)

So if you were doing something with tapply or a [,] subsetting  
operation which might return a single dimensioned result you would  
definitely want NROW.
David Winsemius, MD
West Hartford, CT