size {ACCLMA} | R Documentation |
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
size(mat)
mat |
Any data set |
An integer representing the number of rows in the data set
Tal Carmi, Liat Gaziel
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) }