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