# NOT RUN {
d <- data.frame(grp = rep(c("A", "B"), each = 5))
d$s <- selectall(
`Option 1` = c(rep(1, 4), rep(0, 6)),
`Option 2` = c(0, 1, 0, 0, 0, 1, 1, 1, 0, 0),
`Option 3` = 1,
`Option 4` = 0
)
summary(tableby(grp ~ s, data = d), text = TRUE)
# }
Run the code above in your browser using DataLab