Firstly, on the 1st row of X-axis, I have got labels like "white.highinc" that is the income for race white, but I have already a category for income level, so I just want the labels to be like white, black etc. for each set of columns.
Second, when I use "scale_fill_manual" function to get different colours for each year, the R shows "Error: Continuous value supplied to discrete scale". But in my data frame YEAR is discrete not continuous. In my data frame there are only three years 1995, 2005 and 2010. What should I do?
ggplot(data = data1, aes(x = interaction(race_code, inc_level, lex.order = TRUE), y = percent_lwpr, group = YEAR, fill=YEAR)) +
geom_bar(stat="identity", position=position_dodge(width=0.8)) +
scale_fill_manual(values=c("#ffa600", "#ff6361", "#bc5090"))+
facet_grid(~inc_level, switch = "x", scales = "free_x", space = "free_x")+
theme(panel.spacing = unit(0, "lines"),
strip.background = element_blank(),
strip.placement = "outside")