size: Counts the number of rows in a data set

Description Usage Arguments Value Author(s) Examples

View source: R/lmafunctions.r

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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)
  }

ACCLMA documentation built on May 2, 2019, 8:49 a.m.