Have a look at the structure

Another method that is often used to get a rapid overview of your data is the function str(). The function str() shows you the structure of your data set. For a data frame it tells you:

Applying the str() function will often be the first thing that you do when receiving a new data set or data frame. It is a great way to get more insight in your data set before diving into the real analysis.

Instruction

Investigate the structure of mtcars. Make sure that you see the same numbers, variables and data types as mentioned above.

# Investigate the structure of mtcars # Investigate the structure of mtcars str(mtcars) test_output_contains("str(mtcars)", incorrect_msg = "Have you correctly called `str()` on `mtcars`?") success_msg("Nice work! Can you find all the information that is listed in the exercise's assignment? Continue to the next exercise.")

Use the str() function on mtcars.

Previous: 5-2 | Quick, have a look at your data set

Next: 5-4 | Creating a data frame

Back to Main