I want to develop a bar plot using this data with the same of columns as shown in the data.
Valley | Female | Young | Yearling | Class1 | Class2 | Class3 |
---|---|---|---|---|---|---|
Hushey | 144 | 160 | 162 | 24 | 18 | 29 |
I tried this code, it produce the bar plot but with changed order of columns. developing bar plot using pivot_longer function, which produced graph but also changed the order of columns.
ibex %>%
pivot_longer(cols = -Valley) %>%
ggplot(aes(x=name,y=value)) +
geom_col() +
facet_wrap(~Valley) +
scale_y_continuous(expand = expansion(0)) +
theme_bw() +
labs(title = "", x="", y="Number of Ibex sighted")