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:
mpg
, cyl
... )num
)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.
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.")