Learn R Programming

graphTweets (version 0.5.3)

gt_dyn: Dynamise

Description

Create a dynamic graph to import in Gephi.

Usage

gt_dyn(gt, lifetime = Inf)

Arguments

gt

An object of class graphTweets as returned by gt_edges and gt_nodes.

lifetime

Lifetime of a tweet in milliseconds, defaults to Inf.

Examples

Run this code
# NOT RUN {
# simulate dataset
tweets <- data.frame(
  text = c("I tweet @you about @him and @her", 
           "I tweet @me about @you"),
  screen_name = c("me", "him"),
  created_at = c(Sys.time(), Sys.time() + 10000),
  status_id = c(1, 2),
  stringsAsFactors = FALSE
)

tweets %>% 
  gt_edges(text, screen_name, status_id, "created_at") %>% 
  gt_nodes() %>% 
  gt_dyn() %>% 
  gt_collect() -> net
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab