In ggplot, It's easy to draw lines:
library(ggplot2)
library(ggpp)
ggplot() +
geom_abline(aes(intercept = 0, slope = 2)) +
geom_abline(aes(intercept = 0, slope = 5)) +
geom_quadrant_lines()
But what if I want to draw rays, i.e. lines which extend to infinity only from one side?
I want my rays to start at the origin and extend into the 3rd quadrant.
One could use geom_segment
to do something like this, but the problem is that I don't know the xend
and yend
parameters since the ray doesn't really end.
So how could I achieve this?