Get the number of rows of an Object in R Programming - nrow() Function Last Updated : 09 Mar, 2021 Comments Improve Suggest changes Like Article Like Report nrow() function in R Language is used to return the number of rows of the specified matrix. Syntax: nrow(x)Parameters: x: matrix, vector, array or data frame Example 1: Python3 # R program to illustrate # nrow function # Getting R Biochemical Oxygen Demand Dataset BOD # Calling nrow() function to # get the number of rows nrow(BOD) Output: Time demand 1 1 8.3 2 2 10.3 3 3 19.0 4 4 16.0 5 5 15.6 6 7 19.8 [1] 6 Example 2: Python3 # R program to illustrate # nrow function # Specifying a matrix x <- matrix(c(1, 2, 3, 4), 1, 4) # Calling the nrow() function nrow(x) Output: [1] 1 Comment More infoAdvertise with us Next Article Get the number of rows of an Object in R Programming - nrow() Function K Kanchan_Ray Follow Improve Article Tags : R Language R DataFrame-Function R Vector-Function R Object-Function R Matrix-Function +1 More Similar Reads Get the number of columns of an Object in R Programming - ncol() Function ncol() function in R Language is used to return the number of columns of the specified matrix. Syntax: ncol(x)Parameters: x: matrix, vector, array or data frame  Example 1:  Python3 # R program to illustrate # ncol function # Getting R Biochemical Oxygen Demand Dataset BOD # Calling ncol() functi 1 min read Getting a Matrix of number of rows in R Programming - row() Function In this article, we will discuss how to find the number of rows and columns in a matrix in R Programming Language. nrow() Function in Rnrow() function in R Language is used to get the row number of a matrix. Syntax: row(x, as.factor=FALSE) Parameters:x: matrixas.factor: a logical value indicating w 2 min read Get the Maximum element of an Object in R Programming - max() Function max() function in R Language is used to find the maximum element present in an object. This object can be a Vector, a list, a matrix, a data frame, etc.. Syntax: max(object, na.rm) Parameters: object: Vector, matrix, list, data frame, etc. na.rm: Boolean value to remove NA element. Example 1: Python 1 min read Calculate the Mean of each Row of an Object in R Programming â rowMeans() Function rowMeans() function in R Language is used to find out the mean of each row of a data frame, matrix, or array. Syntax: rowMeans(data) Parameter: data: data frame, array, or matrix Example 1 Python3 1== # R program to illustrate # rowMean function # Create example values # Set seed set.seed(1234) # Cr 1 min read Get the Number of Levels of a Factor in R Programming - nlevels() Function nlevels() function in R Language is used to get the number of levels of a factor. Syntax: nlevels(x) Parameters: x: Factor Object Example 1: Python3 1== # R program to get the number # of levels of a factor # Creating a factor x <- gl(3, 2) x # Calling nlevels() function # to get the number of le 1 min read Like