Summarizing the data into a data frame

To get a summary of the data, we may execute summary(data) and see the relevant summaries for each type of variable. The summary is tailored for each column's data type. As you can see, numerical variables such as ID and NVotes get a quantile summary, while factor (categorical) variables get a count for each different category, such as AreaType and RegionName. If there are many categories, the summary will show the categories that appear the most and group the rest into a (Other) group, as we can see at the bottom of RegionName.

summary(data)#>       ID        RegionName              NVotes          Leave#> Min.   :  1    Length: 1070        Min.   : 1039    Min.   : 287#> 1st Qu.: 268   Class : character   1st Qu.: 4252    1st Qu.: 1698#> Median : 536 Mode : character ...

Get R Programming By Example 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.