Which function in R returns the number of rows in a data frame?

Which function in R returns the number of rows in a data frame?

a) ncol()
b) length()
c) nrow()
d) count()

Answer:

c) nrow()

Explanation:

The nrow() function returns the number of rows in a data frame or matrix.

Reference:

R Programming – Functions MCQ Questions and Answers

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top