Downloads tract-level household head income via censobr and
produces a scatter plot or side-by-side map of income vs. vote share.
Usage
plot_income(
result,
variable = NULL,
census_year = NULL,
type = c("scatter", "map"),
...
)Arguments
- result
An
interpElections_resultobject (Brazilian).- variable
Variable to correlate with income. Accepts column name, ballot number, candidate name, or party abbreviation.
- census_year
Census year for income data. NULL auto-detects from
result$census_year. Must be 2000, 2010, or 2022.- type
Character.
"scatter"(default) or"map".- ...
Ignored.
Details
Income data is downloaded from IBGE via the censobr package.
No deflation is applied — values are used as-is for within-year
correlation analysis.
Variable sources by census year:
2000:
censobr::read_tracts(2000, "Basico"), variableVAR062010:
censobr::read_tracts(2010, "ResponsavelRenda"), computed asV022 / V0202022:
censobr::read_tracts(2022, "ResponsavelRenda"), variableV06004