number of rows in a dataframe in r code example Example: select number of row dataframe r df <- df[1:5,]