r number of rows in dataframe code example Example 1: how to find number of rows in datafram R nrow(<dataframe>) Example 2: select number of row dataframe r df <- df[1:5,]