edges_from_text: Edges from text

Description Usage Arguments Details Value Functions Examples

Description

Get edges from data.frame of tweets.

Usage

1
2
3
4
5
6
7
8
9
gt_edges_from_text(data, id, source, tweets, ...)

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

Arguments

data

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

id

tweets unique id.

source

Author of tweets.

tweets

Column containing tweets.

...

any other column name.

Details

The tl arguments stands for tolower and allows converting the #hashtags to lower case as these often duplicated, i.e.: #python #Python.

Value

An object of class graphTweets.

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# simulate dataset
tweets <- data.frame(
  text = c("I tweet @you about @him and @her", 
           "I tweet @me about @you"),
  screen_name = c("me", "him"),
  retweet_count = c(19, 5),
  status_id = c(1, 2),
  hashtags = c("rstats", "Python"),
  stringsAsFactors = FALSE
)

tweets %>% 
  gt_edges_from_text(status_id, screen_name, text)
    

JohnCoene/graphTweets documentation built on Jan. 8, 2020, 2:48 a.m.