How would I plot a bar chart showing the percentage within gender for each of the different levels of var
The data can be built as follows:
structure(list(var = structure(c(5L, 5L, 5L, 6L, 5L, 4L, 5L,
6L, 6L, 6L, 5L, 5L, 5L, 6L, 6L, 5L, 6L, 5L, 6L, 5L), .Label = c("-97:\nMultiple\nResponse",
"-99:\nRefused", "1:\nDefinitely", "2:\nProbably", "3:\nProbably\nnot",
"4:\nDefinitely\nnot"), class = "factor"), GENDER = structure(c(1L,
2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 1L,
1L, 2L, 1L), .Label = c("1: Male", "2: Female", "3: Unknown"), class = "factor")), .Names = c("var",
"GENDER"), row.names = c(NA, 20L), class = "data.frame")
I want the bars within gender
to each add up to 100%