Data type checks with str()

We are going to leverage here the str() function, which we already met some paragraphs ago. We employed this function to get a closer look at our data frame, and we already noticed that it results in a list of vectors, each of which shows the name of a different column, the type of that column (even if we would better say the type of the vector forming that column), and the first ten records of it. We are now going to try to look more carefully through the output and see if some kind of strange result appears:

str(clean_stored_data)

This will result in:

'data.frame': 27060 obs. of  15 variables: $ attr_3         : num  0 0 0 0 0 0 0 0 0 0 ... $ attr_4         : num  1 1 1 1 1 1 1 1 1 1 ... $ attr_5         : chr  "0" "0" "0" "0" ... $ attr_6 ...

Get R Data Mining now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.