source and target functions in igraph package in R What are the source and target functions in igraph package in R?  so that source(s->t) = s and target(s->t) = t

I am working on this directed graph example:

require(igraph, quietly=TRUE)
bsk &lt;-read.table("http://www.dimiter.eu/Data_files/edgesdata3.txt", sep='\t', dec=',', header=T)

bsk.network &lt;- graph.data.frame(bsk, directed=T) 


edit: I am trying to write a function like this:

f_source &lt;- function(str,network){
 result &lt;- head_of(network, E(network)[str]); 
}

f_source(AA%-&gt;%DD,bsk.network)


The problem is the string. It includes quotations while E(network)[str] does not work with quotations.
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.