Description Usage Arguments Value Examples
Create a graph from conversation data, in which ties are drawn between each authors in the conversation and the first author.
1 2 | first.author.graph(conversation, author, order.nr, direction = "directed.up",
once.per.conversation = TRUE)
|
conversation.id |
A vector representing the conversation authors were engaged in (e.g. a thread, meeting) |
author |
A vector with unique author names/ids |
order.nr |
Optional. A vector representing the order in which authors communicated within a conversation. |
direction |
A character string, indicating the direction of the ties. If 'undirected', ties between authors go both ways. If 'directed.up', ties are directed from author to previous authors (only if order is given). if 'directed.down', ties are directed from author to later authors. |
once.per.conversation |
Logical. If TRUE, count only the number of conversations in which a first-author <-> later-author coincidence occurs. It is then ignored how many times the later author participated in the conversation. If FALSE, the number of participation times is counted. |
A graph object in the igraph
format
1 2 3 4 5 6 7 8 9 10 11 | d = data.frame(conversation=c(1,1,1,1,1,1,2,2,2,2),
author=c('Alice','Bob','Alice','Dave','Bob','Bob','Alice','Bob','Alice','Bob'),
order.nr=c(1,2,3,4,5,6,1,2,3,4))
g = first.author.graph(d$conversation, d$author, d$order.nr) # in how many conversations initiated by author.Y did author.X communicate?
plot(g, edge.label=E(g)$weight, vertex.size=V(g)$n.documents*25)
g = first.author.graph(d$conversation, d$author, d$order.nr, once.per.conversation=FALSE) # how many times did author.X communicate in a conversation initiated by author.Y?
plot(g, edge.label=E(g)$weight, vertex.size=V(g)$n.messages*15)
g = first.author.graph(d$conversation, d$author, d$order.nr, direction='undirected') # drop direction author.X and author.Y
plot(g, edge.label=E(g)$weight, vertex.size=V(g)$n.documents*25)
g = first.author.graph(d$conversation, d$author, d$order.nr, direction='directed.down') # switch direction
plot(g, edge.label=E(g)$weight, vertex.size=V(g)$n.documents*25)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.