public
Created

election3

  • Download Gist
election3.r
R
1 2 3 4 5 6 7 8 9 10 11
Ohio <- c()
California <- c()
Alabama <- c()
for ( i in 1:1000) {
Ohio[i] <- sample (c("Obama", "Romney"), 1)
California[i] <- sample(c(rep("Obama", 9), "Romney"))
Alabama[i] <- sample( c(rep("Obama", 1), rep("Romney", 9)), 1)
}
 
ftable(Ohio, California, Alabama)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.