Created
March 3, 2011 02:15
-
-
Save arademaker/852194 to your computer and use it in GitHub Desktop.
constructing truth tables in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(gtools) | |
data <- permutations(2, 3, v = c(T,F), repeats.allowed=TRUE) | |
tt <- as.data.frame(data) | |
names(tt) <- letters[1:3] | |
tt$"! (a | b) | c" <- (!(tt$a | tt$b) | tt$c) | |
# unusual output! | |
xtable(tt) | |
print(xtable(sapply(tt, as.character)), include.rownames=F) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment