Learn R Programming

SocialMediaLab (version 0.20.0)

Collect: Collect data from social media for generating networks

Description

This function collects data from social media API, and structures the data into a data frame of class dataSource.*, ready for creating networks for further analysis. Collect is the second step of the Authenticate, Collect, Create workflow.

Usage

Collect(credential, ego = FALSE, ...)

Arguments

credential
credential object generated from Authenticate
ego
logical, collecting ego network data. Currently only support Instagram.
...
additional parameters for data collection (refer to CollectDataFrom* and CollectEgo* functions)

facebook: pageName, rangeFrom, rangeTo, verbose, n, writeToFile, dynamic

youtube: videoIDs, verbose, writeToFile, maxComments

Value

  • A data.frame object of class dataSource.* that can be used with Create.

See Also

CollectDataFromFacebook, CollectDataFromInstagram, CollectDataFromYoutube, CollectDatFromTwitter, CollectEgoInstagram

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