head(): Look up the first entries in variables

  head()  and  tail() returns the first or last parts of a vector, matrix, table, data frame or function.  Since head() and  tail() are generic functions, they may also have been extended to other classes. 

Instruction

# Print all values 'iris'. print(iris) # Use head function to see the first six entries in iris dataset. # Use tail function to see the last six entries in iris dataset. # Print all values 'iris'. print(iris) # Use head function to see the first six entries in iris dataset. head(iris) # Use tail function to see the last six entries in iris dataset. tail(iris) test_function("head") test_function("tail") success_msg("Great! Head over to the next exercise.")

Previous: 1-3 | data(): Prebuilt datasets

Next: 1-5 | ls(): Lists of variables saved in the workspace

Back to Main