Select first or last rows of a data frame

We often do not need to look at all the contents of a data frame in the console. Instead, only parts of it are sufficient like the top or bottom retrieved through the head() and tail() functions.

  • Select the top of a data frame
  • Select the bottom of a data frame
  • Specify the number of lines to select through the parameter n
head(___, n = ___)
tail(___, n = ___)
View Interactive Version
Select first or last rows of a data frame