I'm having trouble getting my bars in the correct order. I tried ungrouping but I just have no idea what's causing this error. Any help would be appreciated
library(tidyverse)
structure(list(
estimate = c(11.111247470798, 10.4662218220111,
9.87286101475029, 8.96746112935442, 8.92108170016026, 7.08832829986602,
7.04818865012549, 6.62726882286672, 6.4016658616157, 5.90243717932255,
-8.06613096601733, -8.2327856904955, -8.29332173766532, -8.54770470136022,
-8.82071952004217, -9.3058109157512, -9.46824772100271, -10.2010370607916,
-12.1533813085304, -13.1205784952985), term = c("player", "day",
"1", "improve", "hardest", "initial", "sophomore", "extremely",
"player", "player", "finish", "dont", "fair", "limit", "expect",
"solid", "degree", "degree", "dont", "ran"),
direction = c("Positive",
"Positive", "Positive", "Positive", "Positive", "Positive", "Positive",
"Positive", "Positive", "Positive", "Negative", "Negative", "Negative",
"Negative", "Negative", "Negative", "Negative", "Negative", "Negative",
"Negative")), row.names = c(NA, -20L), class = c("tbl_df", "tbl",
"data.frame")) %>%
mutate(term = fct_reorder(term, estimate, max)) %>%
ggplot(aes(term, estimate, fill = direction)) +
geom_col(show.legend = F) +
coord_flip()
Created on 2020-07-18 by the reprex package (v0.3.0)