Skip to content

Instantly share code, notes, and snippets.

@pbiecek
Created March 26, 2015 08:30
Show Gist options
  • Save pbiecek/8765ca59b68a321a0cd8 to your computer and use it in GitHub Desktop.
Save pbiecek/8765ca59b68a321a0cd8 to your computer and use it in GitHub Desktop.
# select only specific cols
group1 <- "Males"
group2 <- "Females"
# convert characters to numbers
xx <- as.numeric(votesGroup[,group1])
yy <- as.numeric(votesGroup[,group2])
gr <- cut(xx - yy, c(-10,-0.5,0.5,10))
df <- data.frame(x = xx, y = yy, gr = gr,
name = votesGroup[,"serialName"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment