Learn R Programming

SocialMediaLab (version 0.23.2)

CreateDynamicNetwork: Note: this function is DEPRECATED and will be removed in a future release.

Description

Create dynamic networks from social media data (networks that vary over time)

Usage

CreateDynamicNetwork(x, writeToFile)

Arguments

x
a data frame of class dataSource and class temporal.
writeToFile
logical. If TRUE then the network is saved to file in current working directory (GRAPHML format), with filename denoting the current date/time and the type of network.

Value

An igraph graph object, with directed and non-weighted edges.

Details

This function creates a dynamic network from social media data (i.e. from data frames of class dataSource and class temporal).

This function creates a directed network from a data frame of class dataSource and temporal (which are created using the `CollectTemporalData` family of functions in the SocialMediaLab package).

The resulting dynamic network is an igraph graph object. This graph object is dynamic because all edges in the network have a timestamp attribute expressing their existence as a function of time. Edges are directed and non-weighted (i.e. for each 'interaction' between two vertices there exists an edge with a timestamp attribute). For example, a Facebook user i may 'comment on' post j at time T1 and T2, which is represented by two edges with timestamp attribute T1 and T2, respectively.

References

Kolaczyk, E. D., Csardi, G. (2014). Statistical analysis of network data with R. New York: Springer, Chapter 10.

See Also

See CollectDataFacebook to collect data for creating dynamic networks in SocialMediaLab.

Examples

Run this code

## Not run: ------------------------------------
#   ## This example shows how to collect Facebook page data and create a bimodal network
# 
#   # Use your own values for myAppID and myAppSecret
#   myAppID <- "123456789098765"
#   myAppSecret <- "abc123abc123abc123abc123abc123ab"
# 
#   # Authenticate with the Facebook API using `AuthenticateWithFacebookAPI`
#   fb_oauth <- AuthenticateWithFacebookAPI(appID=myAppID, appSecret=myAppSecret,
#     extended_permissions=FALSE, useCachedToken=TRUE)
# 
#   # Run the `CollectTemporalDataFacebook` function and
#   # store the results in variable `myTemporalFacebookData`
#   myTemporalFacebookData <- CollectTemporalDataFacebook(pageName="StarWars",
#     rangeFrom="2015-05-14",rangeTo="2015-06-04",verbose=FALSE,writeToFile=FALSE)
# 
#   # Create a dynamic 'bimodal' Facebook network using `CreateDynamicNetwork`
#   g_bimodal_dynamic_facebook <- CreateDynamicNetwork(myTemporalFacebookData)
# 
#   # View descriptive information about the bimodal network
#   g_bimodal_facebook
## ---------------------------------------------

Run the code above in your browser using DataLab