This package contains a large dataset with data for counties in the United States. This came comes from several sources, see this paper. The electoral data is from the New York Times. The variable names are not pretty, but they should be self-explanatory for most purposes. There are some errors with a few counties, but there are good data for ~3100 counties. Note that Alaska has no counties and as such is included as a state. It has no data for 2008-2012.
Install it from github with:
rds and csv files are also provided.