I have the following data:
| Category | albumin | protein | cholesterol | urea |
|---|---|---|---|---|
| placebo | 24,04 | 61,45 | 63,09 | 19,04 |
| placebo | 25,86 | 57,63 | 111,04 | 14,30 |
| placebo | 28,18 | 64,18 | 108 | 18,68 |
| test | 23,77 | 61,45 | 70,59 | 17,43 |
| test | 26,22 | 57,54 | 123,45 | 13,68 |
| test | 27,90 | 65,36 | 106,22 | 18,63 |
And I would like to plot the different blood parameters on the same plot with 2 different colors for the category placebo or test. Here is the code and what I have:
plot <- ggplot()+
geom_line(data = file, aes(x = date, y = albumin, color = category)) +
geom_line( data = file, aes(x = date, y = protein, color = category)) +
scale_color_brewer(palette = "Set1") +
theme_minimal(base_size = 16)
plot + xlab("Days at blood sampling") + ylab("Blood parameters")
My issue is to add a label with the name of each blood parameter next to each line, a bit like this:
How can I do this?


