Description Usage Arguments Details Value Author(s) Examples
Using the output of tw_extract()
and the author of the message,
creates a graph
1 2 |
source |
Vector of screen_name |
target |
List of vectors of mentions (output from |
only.from |
Whether to filter the links to those only where
source and target are in the |
exclude.self |
Whether to exclude self-links |
min.interact |
Minimun number of interactions to consider (links below this number will be excluded) |
group |
Data frame with two columns: name & group |
size |
A data frame with two columns: name & size |
ignore.case |
When |
The value
column in the links
dataframe (see Value)
is computed as the number of connexions between the source and the target.
A two-element list containing two data.frames, nodes and links of
class tw_Class_graph
(to be used with plot.tw_Class_graph()
.
The nodes data.frame includes two columns, id
, name
and
group
. The links data.frame includes three columns, source
,
target
and value
.
George G. Vega Yon
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ## Not run:
# Loading sample data and retrieving mentions
data(senate_tweets)
mentions <- tw_extract(senate_tweets$text, obj="mention")$mention
# Preparing data for size. Here we are just setting a random size for
# each vertex.
usrs<- tolower(senate_tweets$screen_name)
size <- data.frame(name=unique(usrs),
size=exp(runif(length(unique(usrs)))*5))
# Creating the graph
graph <- tw_network(
usrs, mentions, min.interact = 5, size=size)
# Visualizing the graph
plot(graph)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.