79681604

Date: 2025-06-27 08:07:02
Score: 2.5
Natty:
Report link

Something like this?

ID <- (rep(c(1, 2),each= 3))
Datum <- c("2017-05-06", "2017-06-07", "2017-08-04", "2017-06-24", "2017-07-05", "2017-10-01")
Dose <- c(50, 60, 70, 40, 50, 40)
Dat <- data.frame(ID, Datum, Dose)


library(ggplot2)

# original plot
p <- ggplot(data = Dat, aes(Datum, Dose, color = as.factor(ID), group = as.factor(ID))) + 
  geom_line() + 
  geom_point() +
  labs(x = "Date", y = "Dose", color = "ID") +
  theme_minimal()

# specific coordinates
highlight_df <- Dat[c(3, 5, 6), ]

# final plot
p + geom_point(data = highlight_df, aes(Datum, Dose), shape = 4, size = 5, color = "red", stroke = 1.5) 

Output: enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: MetehanGungor