-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02-packages.Rmd
60 lines (36 loc) · 2.97 KB
/
02-packages.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Packages {#pkgs}
Below are the packages that make up in the _twinetverse_ as well as some explanation as to what they bring to visualising Twitter interactions. Though considered a package the 'verse itself only comes with two functions, all other functions used in this book are part of the packages detailed below.
## rtweet
<a href="http://rtweet.info/" target="_blank">
<img src="http://rtweet.info/reference/figures/logo.png" align="left" style="max-height:150px;margin-right:2%;"/>
</a>
If we are going to visualise Twitter interactions we are going to need data, namely tweets. The rtweet package [@R-rtweet] wraps the [Twitter API](https://developer.twitter.com/en/docs.html), thereby giving R users easy access to tweets.
From the [official website](http://rtweet.info):
> [rtweet is an] R client for accessing Twitter's REST and stream APIs
### Usage
rtweet fills the very first step in visualising Twitter interactions, **collecting** the necessary data.
_Note that the package lets you do much more than simply downloading tweets, however, within the twinetverse, this is its main function._
## graphTweets
<a href="http://graphTweets.john-coene.com/" target="_blank">
<img src="http://graphtweets.john-coene.com/logo.png" align="left" style="max-height:150px;margin-right:2%;"/>
</a>
### Rationale
The graphTweets package [@R-graphTweets] lets you extract nodes and edges from tweets collected with rtweet. The package is fairly straighforward as it inludes just a few functions. However, it still enables you to build a wide variety of graphs.
The package revolves around two core functions which respectively allow you to build data.frames of edges and nodes. These edges and nodes (also referred to as vertices) together map Twitter interactions.
Though the package also allows returning igraph objects (@R-igraph) this is not necessary in the _twinetverse_, and therefore not demonstrated in this book. More information is available on the package's [official website](http://graphTweets.john-coene.com/).
### Usage
All functions of the package start with `gt_`. graphTweets fills the second step in visualising Twitter interactions, **building** the graphs from the collected data.
## sigmajs
<a href="http://sigmajs.john-coene.com/" target="_blank">
<img src="http://sigmajs.john-coene.com/reference/figures/logo.png" align="left" style="max-height:150px;margin-right:2%;"/>
</a>
The sigmajs package [@R-sigmajs] is a powerful library to visualise the networks we have built using graphTweets. The package, like graphTweets, is pipe-friendly (`%>%`), thereby making it easy to go from building a graph to visualising it. It can also easily represent dynamic networks, something otherwise not evident in R.
**Features**:
* Highly interactive
* Crosstalk integrated
* Includes Shiny proxies
* Events in Shiny
* Buttons to trigger interactions.
* and more.
### Usage
All functions of the package start with `sg_`. sigmajs is the final piece of the puzzle, **visualising** the graphs we have built.