I have the following code. I want to color the USA value in red. But it keeps coloring the place where the USA would've been if I hadn't reordered it. Why? I've tried changing countries into factors, to no avail.
# Sort the data frame by 'val' in ascending order
df <- df[order(df$val), ]
# plot
p <- ggplot(data = df,
aes(x = reorder(country, val),
y = val,
fill = country)) +
geom_bar(stat = "identity") +
scale_fill_manual(values =
ifelse(density_df$country == "USA", "red", "darkblue")) +
theme_minimal()