Skip to content

Commit

Permalink
Adds nay demarcacion candidates and winners 2008
Browse files Browse the repository at this point in the history
  • Loading branch information
emagar committed Dec 12, 2018
1 parent 52be0ef commit de1eb2f
Show file tree
Hide file tree
Showing 6 changed files with 9,758 additions and 577 deletions.
18 changes: 13 additions & 5 deletions code/incumbents.r
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,17 @@ sel <- grep("pan-", inc$win2, ignore.case = TRUE)
inc$win2[sel] <- "pan"
sel <- grep("pri-", inc$win2, ignore.case = TRUE)
inc$win2[sel] <- "pri"
sel <- grep("prd-", inc$win2, ignore.case = TRUE)
sel <- grep("prd-|-prd", inc$win2, ignore.case = TRUE)
inc$win2[sel] <- "prd"
sel <- grep("morena-|-morena", inc$win2, ignore.case = TRUE)
inc$win2[sel] <- "morena"
sel <- grep("pvem-|-pvem", inc$win2, ignore.case = TRUE)
inc$win2[sel] <- "pvem"
sel <- grep("mc-|-mc", inc$win2, ignore.case = TRUE)
inc$win2[sel] <- "mc"
sel <- grep("mas|paz|pcp|phm|pmr|ppg|psd1|psi|pudc|pup|via_|pchu|pmch|pver|prs|prv|ps1|poc|pjs|pd1|pec|pasd|pac1|npp|pcu|pcdt|pmac|pcm2|pdm|pps|ppt|ph|pmp|fc1|pcd1|psn", inc$win2, ignore.case = TRUE)
sel <- grep("-pes", inc$win2, ignore.case = TRUE)
inc$win2[sel] <- "pes"
sel <- grep("mas|paz|pcp|phm|pmr|ppg|psd1|psi|pudc|pup|via_|pchu|pmch|pver|prs|prv|ps1|poc|pjs|pd1|pec|pasd|pac1|npp|pcu|pcdt|pmac|pcm2|pdm|pps|ppt|ph|pmp|fc1|pcd1|psn|ave", inc$win2, ignore.case = TRUE)
inc$win2[sel] <- "loc/oth"
#
inc$win.prior2 <- inc$win.prior
Expand Down Expand Up @@ -277,11 +279,17 @@ table(inc$race.prior[inc$win!="" & inc$win.prior!=""]) # check classification
rm(tmp, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, sel.tl, sel.e, sel.m, sel.7, duplic.win, duplic.win.prior)
#
## table(inc$manipule[inc$win!="" & inc$win.prior!=""]) # debug
table(inc.sub$win) # debug
## data.frame(inc.sub$win.prior[sel], inc.sub$win[sel]) # debug
## data.frame(inc.sub$win.prior[sel1], inc.sub$win[sel1]) # debug

table(inc$yr) # debug
table(inc.sub$win2) # debug
table(inc$win2, inc$race.prior) # debug


inc.sub

## data.frame(inc.sub$win.prior[sel], inc.sub$win[sel]) # debug
## data.frame(inc.sub$win.prior[sel1], inc.sub$win[sel1]) # debug
#


#############################################
Expand Down
Loading

0 comments on commit de1eb2f

Please sign in to comment.