Re: [R] stacked and dodged bar graph ggplot

2016-12-30 Thread Jim Lemon
Hi Robert, I realize that this isn't in ggplot, but are you looking for something like this? Demog <- data.frame(source=c(rep("Davis",4),rep("Dixon",4),rep("Winters",4)), group =c("Asian / Pacific Islander","Caucasian","Latinx", "Not Latinx","African American", "Native American", "Latinx", "Not

Re: [R] stacked and dodged bar graph ggplot

2016-12-30 Thread Ulrik Stervbo
You can use the tidyr package to combine race and enth into one column and fill by that. Then you get one colour for race and one for enth. HTH Ulrik On Fri, 30 Dec 2016, 20:12 Richard M. Heiberger, wrote: > I reproduced your graphs, but I don't understand what you want instead. > > There are s

Re: [R] stacked and dodged bar graph ggplot

2016-12-30 Thread Richard M. Heiberger
I reproduced your graphs, but I don't understand what you want instead. There are several problems. one group is spelled "Lantinx". your factor statements mostly lead to NA values. The two panels of the plot do not use the same number of inches of the plotting window, due to different widths

[R] stacked and dodged bar graph ggplot

2016-12-30 Thread Robert Lynch
I have some census data with race and ethnicity for various towns. I am trying to make a stacked bar graph where all the race data is in one stacked bar, and all the ethnicity data is in another. Below is a minimal reproducible sample. library("ggplot2") Demog <- data.frame(source=c(rep("Davis"