I'm a college student and we have to create some graphs using Rstudio for an assignment. I've managed to do the core objective for this first task, which is to create a simple bar graph with the provided data; however, I'm having trouble with labeling the axes with the desired text.
Here's the code:
library (ggplot2)
Country = as.factor(c("slovakia", "iceland", "lithuania"))
Waste = c(2.0, 3.7, 2.1, 2.3, 1.7, 2.5)
Year = as.factor(c("2004", "2018"))
data = data.frame(Country, Waste, Year)
ggplot(data,
aes(x = Country,
y = Waste,
fill = Year)) +
geom_bar(stat = "identity",
position = "dodge")
xlab("Country")
ylab("Tons of waste per capita")
But I want the axis labels to have this specific text (made with Word):

Please note that we were specifically asked to use ggplot.

