Learn R Programming

SocialMediaLab (version 0.20.0)

Create: Create networks from social media data

Description

This function creates network from social media data (i.e. from data frames of class dataSource , or for Twitter data it is also possible to provide a *list* of data frames).Create is the final step of the Authenticate, Collect, Create workflow.

Usage

Create(dataSource, type = "Actor", ...)

Arguments

dataSource
a data frame of class dataSource. For Twitter data, it is also possible to provide a *list* of data frames (i.e. data frames that inherit class dataSource and twitter). Only lists of Twitter data frames are supported
type
character, type of network to be created, currently supports "actor", "bimodal", "dynamic", "semantic" and "ego"
...
additional parameters for Create*Network functions

Value

  • An igraph graph object

See Also

CreateActorNetwork, CreateBimodalNetwork, CreateDynamicNetwork, CreateSemanticNetwork, CreateEgoNetworkFromData

Examples

Run this code
require(magrittr)
## Instagram ego network example
myAppID <- "123456789098765"
myAppSecret <- "abc123abc123abc123abc123abc123ab"
myUsernames <- c("senjohnmccain","obama")

Authenticate("instagram",
appID = myAappId,
appSecret = myAppSecret) %>% Collect(ego = TRUE,
username = myUsernames) %>% Create

## YouTube actor network example
my_apiKeyYoutube <- "314159265358979qwerty"
videoIDs <- c("W2GZFeYGU3s","mL27TAJGlWc")

Authenticate("youtube",
apiKey = my_apiKeyYoutube) %>% Collect(videoIDs = videoIDs) %>% Create('actor')

Run the code above in your browser using DataLab