Skip to content

Instantly share code, notes, and snippets.

@cdesante
Created November 8, 2012 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdesante/4035628 to your computer and use it in GitHub Desktop.
Save cdesante/4035628 to your computer and use it in GitHub Desktop.
election3
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment