dynamise: Make a dynamic graph

Description Usage Arguments Details Author(s) Examples

View source: R/dynamize.R

Description

Create a dynamic graph from tweets and, optionally, open it in Gephi

Usage

1
2
3
dynamise(data, tweets, source, start.stamp, end.stamp = NULL,
  str.length = NULL, write = FALSE, format = "graphml",
  file.dir = getwd(), file.name = "graphTweets", open = FALSE)

Arguments

data

data.frame of tweets, typically returned by searchTwitter, required.

tweets

Column name of tweets within data, must be a character string, required.

source

User names or ID column of tweets author, must be a character string, required.

start.stamp

Typically a date or time, but may also be an interger or a factor, cannot be a character.

end.stamp

The end of the time stamp, or when edges are to leave the graph, defaults to NULL (edges never disappear). See details.

str.length

Defaults to NULL. Shorten length of @tags (see details in getEdges), to a maximum number of characters, optional.

write

if TRUE saves graph as file.

format

if write = TRUE set format of file, defaults to graphml (see details for valid formats).

file.dir

if write = TRUE directory where to save the file, defaults to working directory.

file.name

if write = TRUE name of file

open

if write = TRUE, open = TRUE opens file in https://gephi.org/.

Details

end.stamp: When the edges are to disappear (consider lifetime of a tweet), by default edges stay on the graph forever.

Valid values for format:

Author(s)

John Coene [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
tweets <- data.frame(text = c("I tweet @you about @him",
                              "I tweet @me about @you"),
                       screenName = c("me", "him"),
                       created = as.Date(c("2016-01-01", "2016-02-02")),
                       stringsAsFactors = FALSE)

# create dynamic graph
dyn <- dynamise(tweets, tweets = "text", source = "screenName", 
                start.stamp = "created")
                
# create dynamic graph with 60 min lasting edges
dyn <- dynamise(tweets, tweets = "text", source = "screenName", 
                start.stamp = "created", end = 3600)

## End(Not run)

graphTweets documentation built on April 1, 2018, 12:18 p.m.