if (interactive()) {
gss <- data.frame(
expand.grid(sex=c("female", "male"),
party=c("dem", "indep", "rep")),
count=c(279,165,73,47,225,191))
print(gss)
# Then expand it:
GSS <- untable(gss, freq="count")
head(GSS)
}
Run the code above in your browser using DataLab