Skip to content

pres_results_by_cd data contains many repeated observations #7

@Patrick330

Description

@Patrick330

The pres_results_by_cd data included in the package included many repeated observations, where the same year-state-district combination returns multiple rows with different numbers of votes.

Here are several examples:

politicaldata::pres_results_by_cd %>% filter(year == 2000 & state_abb == 'AK')

state_abb district year total_votes dem other rep
1 AK 1 2000 284492 0.2777020 0.1338878 0.5884102
2 AK 1 2000 285560 0.2766634 0.1371270 0.5862096

politicaldata::pres_results_by_cd %>% group_by(state_abb, year, district) %>% count() %>% filter(n > 1) %>% group_by(year) %>% count()

year n
1 1992 17
2 1996 102
3 2000 422
4 2004 52
5 2008 417
6 2012 47

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions