View source: R/Create.twomode.twitter.R
Create.twomode.twitter | R Documentation |
Creates a 2-mode network from tweets returned from the twitter search query. In this network there are two types of nodes, twitter users who authored or were mentioned in collected tweets and hashtags found within tweets. Network edges represent a users tweets that contain hashtags or mention users screen names.
The creation of twitter 2-mode networks requires text processing and the tokenization of tweets. As such this function requires the additional installation of the tidytext package to achieve this.
## S3 method for class 'twomode.twitter' Create( datasource, type, removeTermsOrHashtags = NULL, rmRetweets = TRUE, verbose = TRUE, ... )
datasource |
Collected social media data with |
type |
Character string. Type of network to be created, set to |
removeTermsOrHashtags |
Character vector. Users or hashtags to remove from the twomode network. For example,
this parameter could be used to remove the user or hashtag that was used to collect the data by removing any nodes
with matching name. Default is |
rmRetweets |
Logical. Do not process retweets in the input data. Default is |
verbose |
Logical. Output additional information about the network creation. Default is |
... |
Additional parameters passed to function. Not used in this method. |
Network as a named list of two dataframes containing $nodes
and $edges
.
## Not run: # twitter 2-mode network creation additionally requires the tidytext # package for working with text data # install.packages("tidytext") # create a twitter 2-mode network graph with the hashtag "#auspol" removed net_2mode <- collect_tw |> Create("twomode", removeTermsOrHashtags = c("#auspol"), verbose = TRUE) # network # net_2mode$nodes # net_2mode$edges ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.