I want to draw a vector with point P(2,4) and point Q(-4,-6). I can easily write this in base plot system.
arrows(0, 0, 2, 4, angle=20) # command to draw vector as arrows.
arrows(0, 0, -4, -6, angle=20) # with angle of the arrow
However, when I want to transform this to ggplot2, I don't know how to continue.
x1 <- c(0,2,-4)
y1 <- c(0,4,-6)
df <- data.frame(x1,y1)
ggplot(df) +
geom_point(aes(x = x1, y = y1))



geom_point, check out the reference for other possible geoms that might draw segments: ggplot2.tidyverse.org/reference