Reputation: 126
I was trying to create a barplot using ggplot but couldn't get the right result. This is my data set:
I'm trying to create a barplot like this:
Upvotes: 0
Views: 38
Reputation: 1039
You would do (assuming your dataframe is called d
):
library(tidyverse)
d %>%
ggplot(aes(x = continent, y = continental_sum)) +
geom_bar(stat = "identity", fill = "blue") +
labs(
title = "Total Death Per Continent",
y = "Total Death Count",
x = ""
)
Upvotes: 1