library(ggplot2)
ggplot(df, aes(x = df_avg, y =difference )) +
geom_point(size=2) +
geom_hline(yintercept = 0, colour = "darkgreen") +
geom_hline(yintercept = mean_diff) +
geom_hline(yintercept = lower, colour = "red", linetype="dashed") +
geom_hline(yintercept = upper, colour = "red", linetype="dashed") +
ggtitle("B") +
ylab("Difference of the two method measurements ") +
xlab("mean of the two method measurements") +
theme(plot.title = element_text(hjust = 0.5))
I still need a legend to the inserted lines or the possibility to enter values next to the lines in the figures. Can someone help me with that?
Best,
Clarissa