Hello everybody,
for the dataset below, I want to display the respective numeric values on the points in a 3 line graph. However, every attempt to include geom_text() into my code, leads to an error of missing y.
I´ll be very greatful for any help, how and where to include this element!!!
ggplot(df_Empl_MinMeanMax, aes(df_Empl_MinMeanMax$Year, group=3)) +
geom_line(aes(y = df_Empl_MinMeanMax$Minimum, linetype = "Minimum"), show_guide=TRUE) +
geom_point(aes(y = df_Empl_MinMeanMax$Minimum), size = 1) +
geom_line(aes(y = df_Empl_MinMeanMax$Mean, linetype = "Mean"), show_guide=TRUE) +
geom_point(aes(y = df_Empl_MinMeanMax$Mean), size = 1) +
geom_line(aes(y = df_Empl_MinMeanMax$Maximum, linetype = "Maximum"), show_guide=TRUE) +
geom_point(aes(y = df_Empl_MinMeanMax$Maximum), size = 1) +
scale_colour_manual(name="Minimum, Mean and Maximum of Employees 2017-2021")+
labs(x="Year", y="Absolute numbers of employees")
data.frame(
stringsAsFactors = FALSE,
row.names = c("2017", "2018", "2019", "2020", "2021"),
Minimum = c(1, 1, 1, 2, 1),
Mean = c(13.7884615384615,
14.421568627451,14.87,15.5360824742268,16.4347826086957),
Maximum = c(142, 138, 140, 144, 143),
Years = c("2017", "2018", "2019", "2020", "2021"),
Year = c("2017", "2018", "2019", "2020", "2021")
)