The head() function is used to get the first rows of a vector or data frame. By default, it will print out the first 6 rows of the object, but you can also specify the number of rows you would like to print out.
The head() function is similar to the tail() function, however, the tail() function will print out the last 6 rows (or the number specified), instead of the first 6 rows (see the tail() function).
Example 1:
# Print out the first 6 rows of MindsetMatters
Example output:
Example 2:
# Print out the first 10 rows of MindsetMatters
head( MindsetMatters , 10)
Example output: