A.5 Checking data types with str

Let’s make sure the columns all have the data types we expect.

Code
str(d)
'data.frame':   1230 obs. of  6 variables:
 $ date  : Date, format: "2021-10-19" "2021-10-19" ...
 $ gid   : chr  "22100001" "22100002" "22100011" "22100013" ...
 $ away  : chr  "BKN" "GSW" "OKC" "SAC" ...
 $ home  : chr  "MIL" "LAL" "UTA" "POR" ...
 $ ascore: num  104 121 86 124 110 97 134 106 121 117 ...
 $ hscore: num  127 114 107 121 98 123 138 124 132 97 ...

That shows the column name, the data type (Date, chr for character, or num for numeric) and shows the first few entries. Fortunately, our date column is Date format, and our score columns are numeric format.