How to draw segments (geom_segment) dynamically in R ggplot?

Given a fixed set of points, I can plot them and add explicit code to connect some of them with geom_segment. If I had a separate data source with all segments' coordinates, is there a way to add a loop for these segments in same plot?

    ggplot() + 
      geom_point(data=cm,mapping = aes(x, y)) +
      # connect every two paired assets based on separate data source
      geom_segment (mapping=aes(x=10,y=10,xend=100,yend=100), arrow=arrow(angle = 8,type ="closed",length = unit(0.10, "inches")), 
size=0.2, linetype=1, color="#cccccc")
+ geom_segment ( ...

Data set:

x,y
10.0, 10.0
100.0, 100.0
...

Segments:

x,y,x2,y2
10.0, 10.0, 100.0,100.0
...


ANSWERS:


You can pass a different data source for each geom. In this case:

ggplot() + 
      geom_point(data = cm, aes(x, y)) +
      geom_segment(data = segment, aes(x = x, y = y, xend = x2, yend = y2),
                   arrow = arrow(angle = 8,type = "closed",length = unit(0.10, "inches")), 
                   size = 0.2, 
                   linetype = 1,  
                   color = "#cccccc")


 MORE:


 ? How to create C# dynamic object?
 ? How can I move my labels to the right with CSS?
 ? Javafx I want to remove the dynamic element in Accordion
 ? Dynamic MVC Model Server side validation
 ? laravel 5.4 dynamic database connection
 ? How to initialize a char array as null within a default constructor?
 ? Java Play Framework creating logged in navigation bar - inserting dynamic html in scala template
 ? Dynamic search and filtering in Excel
 ? Dynamic TableView Swift 3 With Beginning Graph
 ? Switch case is not working in Reactjs