Changing the text in legend in ggplot map R Studio
问题 I am trying to create a US map filled with heat level of flu diseases. I am having 2 issues: I couldn't change the variable text in the legend. The order of the legend is wrong. 1->10->2->... Here is the code. library(maps) library(ggplot2) # Get all states data all_states <- map_data("state") # Clean the data subHeat <- subset(q4_heatMap, WEEK=="4") region <- tolower(subHeat$STATENAME) stateHeat <- subHeat$ACTIVITY.LEVEL stateHeat <- gsub('Level ', '', stateHeat) usHeat <- data.frame(region