I am trying to change the legend title and labels related to the colors. I tried using this answer as a guide, but it didn't seem to have an impact on the legend text. I think it is because I am using a factor, or because I am using a position dodge? The script and outcome are below:
ggplot(ggplot_survey, aes(factor(hurricanes), fill = factor(bldg_flooding))) +
geom_bar(position = position_dodge2(width = 0.9, preserve = "single")) +
facet_wrap(facets = vars(C0_time)) +
scale_color_discrete(labels=c("No", "Yes", "No Response")) +
labs(title = "Would frequent flooding (building) prompt you to install WCS?",
color = "Response",
x = "Reported Hurricane Exposure",
y = "Count"
)
Basically, I want the text above the legend to read "Response", the 0 to be "No", 1 to be "Yes", and NA to be "No Response". Any advice on where I am going wrong?