Learn R Programming

vosonSML (version 0.27.2)

Create.bimodal.twitter: Create twitter bimodal network

Description

Creates a bimodal network from tweets returned from the twitter search query. In this network there are two types of nodes, twitter users who have tweeted (actors) and hashtags found within their tweets. Network edges are weighted and represent hashtag usage by the actor or specifically their tweets that contain a hashtag matching the name of the node they are directed towards.

Usage

# S3 method for bimodal.twitter
Create(datasource, type,
  removeTermsOrHashtags = NULL, writeToFile = FALSE, verbose = FALSE,
  ...)

Arguments

datasource

Collected social media data with "datasource" and "twitter" class names.

type

Character string. Type of network to be created, set to "bimodal".

removeTermsOrHashtags

Character vector. Terms or hashtags to remove from the bimodal network. For example, this parameter could be used to remove the search term or hashtag that was used to collect the data by removing any nodes with matching name. Default is NULL to remove none.

writeToFile

Logical. Save network data to a file in the current working directory. Default is FALSE.

verbose

Logical. Output additional information about the network creation. Default is FALSE.

...

Additional parameters passed to function. Not used in this method.

Value

Named list containing bimodal network as igraph object $graph.

Examples

Run this code
# NOT RUN {
# create a twitter bimodal network graph removing the hashtag '#auspol' as it was used in 
# the twitter search query
bimodalNetwork <- twitterData %>% 
                  Create("bimodal", removeTermsOrHashtags = c("#auspol"), writeToFile = TRUE, 
                         verbose = TRUE)

# igraph object
# bimodalNetwork$graph
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab