size {ACCLMA}R Documentation

Counts the number of rows in a data set

Description

This function counts the number of rows in a data set by running over the first column and stops on the first blank value in this column it finds

Usage

size(mat)

Arguments

mat

Any data set

Value

An integer representing the number of rows in the data set

Author(s)

Tal Carmi, Liat Gaziel

Examples

d <- c(1,1,3,4)
e <- c(5,6,7,8)
f <- c(1,1,1,1)
mydata <- data.frame(d,e,f)
names(mydata) <- c("X","Y","Weight")
size(mydata)

## The function is currently defined as
function (mat) 
{
    i <- 1
    while (!is.na(mat[i, 1]) & !is.null(mat[i, 1])) {
        i = i + 1
    }
    return(i - 1)
  }

[Package ACCLMA version 1.0 Index]