r - How to draw a ggplot2 with facet_wrap, showing percentages from each group, not overall percentages? -
i'd draw ggplot facet_wrap, doesn't show actual table percent, percent of given answer in each group. have this, because want show, answer selected , important each group. groups don't have same size. example data: group <- c(rep(c("group1"), times = 10),rep(c("group2"), times = 6),rep(c("group3"), times = 4)) choice <- c(rep(c("a","b","c"),length.out = 10), "a","a","a","a","b","c","b","b","b","c") df <- data.frame(cbind(group,choice)) it nice, if not use overall prop.t , prop.c show in plot, because important show, example 66.67% of group 2 prefers choice a. library(gmodels) crosstable(choice, group, prop.chisq=false, prop.t = true, prop.c = true, prop.r = false, format = "spss") this plot: library(ggplot2) g <- ggplot(df, aes_string(x="group", fill="group")...