Get the number of rows of an Object in R Programming – nrow() Function Improve Improve Improve Like Article Like Save Article Save Share Report issue 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 DatasetBOD # Calling nrow() function to# get the number of rowsnrow(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 matrixx <- matrix(c(1, 2, 3, 4), 1, 4) # Calling the nrow() functionnrow(x) Output: [1] 1 Last Updated : 09 Mar, 2021 Like Article Save Article Previous Check for Presence of Common Elements between Objects in R Programming - is.element() Function Next Combine Vectors, Matrix or Data Frames by Rows in R Language - rbind() Function Share your thoughts in the comments Add Your Comment Please Login to comment...