Get edges from data.frame of tweets.

gt_edges(data, tweets, source, id, ...)

gt_edges_(data, tweets = "text", source = "screen_name", id = "status_id",
  ...)

Arguments

data

Data.frame of tweets, usually returned by the rtweet package.

tweets

Column containing tweets.

source

Author of tweets.

id

tweets unique id.

...

any other column name, see examples.

Value

An object of class graphTweets.

Examples

# simulate dataset tweets <- data.frame( text = c("I tweet @you about @him", "I tweet @me about @you"), screen_name = c("me", "him"), retweet_count = c(19, 5), status_id = c(1, 2), stringsAsFactors = FALSE ) tweets %>% gt_edges(text, screen_name, status_id)
#> $edges #> # A tibble: 4 x 2 #> source target #> <chr> <chr> #> 1 me you #> 2 me him #> 3 him me #> 4 him you #>
tweets %>% gt_edges_(RT = "retweet_count") # metadata
#> $edges #> # A tibble: 4 x 3 #> source target RT #> <chr> <chr> <dbl> #> 1 me you 19 #> 2 me him 19 #> 3 him me 5 #> 4 him you 5 #>