tut16
✓ Published0🌍 Public
BBenHeubl
Last edited Feb 13, 2020
Created on Feb 13, 2020
This example calculates the mode occupation for each income group using a custom `getmode` function defined in R. The code groups the income dataset by the `INCOME` variable and summarizes it with the mode of `OCCUPATION`, producing a table of the most common occupation per income bracket. It relies on base R functions like `unique`, `tabulate`, and `match`, along with the dplyr verbs `group_by` and `summarise`. The result displays the categorical relationship between income levels and predominant job types, without any graphical output or rendering library.
AI-generated description