source and target functions in igraph package in R
Given

library(igraph)
set.seed(1)
g &lt;- sample_pa(5)


you got

ends(g, E(g))
#      [,1] [,2]
# [1,]    2    1
# [2,]    3    1
# [3,]    4    1
# [4,]    5    2


and

head_of(g, E(g))
# + 4/5 vertices:
# [1] 2 3 4 5

tail_of(g, E(g))
# + 4/5 vertices:
# [1] 1 1 1 2


source() is an important base function.