You can do that by adding
scale_x_discrete(limits = c("Urban","Low_land", "Agricultural", "Wetland","Others"))
So the whole code will look like this:
d <- df %>%
gather(variable, category, -id) %>%
filter(!is.na(category)) %>%
count(variable, category)
ggplot(data = d, aes(x = variable,
y = n,
fill = factor(category, labels = c("Not Sensitive", "Slightly Sensitive", "Sensitive", "Very Sensitive")))) +
geom_col() +
labs(x = "Sensitivity",
y = "Count",
fill = "Category") +
scale_x_discrete(limits = c("Urban","Low_land", "Agricultural", "Wetland","Others"))+
theme(axis.text.x = element_text(angle=30, hjust=1, vjust = 1))