-
Notifications
You must be signed in to change notification settings - Fork 27
/
index.Rmd
47 lines (33 loc) · 2.57 KB
/
index.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
---
title: "21 Recipes for Mining Twitter Data with rtweet"
author: "Bob Rudis"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
documentclass: book
bibliography: [book.bib]
biblio-style: apalike
link-citations: yes
github-repo: hrbrmstr/21-recipes
url: 'https\://rud.is/books/21-recipes/'
description: "An R/rtweet edition of Matthew A. Russell's Python Twitter Recipes Book"
---
# Preface {-}
I'm using this as a way to familiarize myself with bookdown so I don't make as many mistakes with my web scraping field guide book.
It's based on Matthew R. Russell's [book](https://github.com/ptwobrussell/Recipes-for-Mining-Twitter). That book is out of distribution and much of the content is in Matthew's "Mining the Social Web" book. There will be _many_ similarities between his "21 Recipes" book and this book _on purpose_. I am not claiming originality in this work, just making an R-centric version of the cookbook.
As he states in his tome, "this intentionally terse recipe collection provides you with 21 easily adaptable Twitter mining recipes".
The recipes contained in this book use the [`rtweet`](http://rtweet.info/) package by [Michael W. Kearney](https://github.com/mkearney). I'll be using the [GitHub](https://github.com/mkearney/rtweet) version of the package since it has some cutting-edge features and bug-fixes in it.
You can install the GitHub version of [`rtweet`] by first installing the [`devtools`](https://github.com/hadley/devtools) package via:
```{r eval=FALSE}
install.packages("devtools")
```
then installing the GitHub `rtweet` package via:
```{r eval=FALSE}
devtools::install_github("mkearney/rtweet")
```
>NOTE: If you try to run examples in this book and receive an error about a package not being found or not available, you'll need to triage it by using one of the above methods. If any GitHub packages are used, each initial `library()` call will have a comment after it noting which `repository/packagename` to use the `devtools` method with.
Matthew also states that "one other thing you should consider doing up front, if you haven’t already, is quickly skimming through the official Twitter API documentation and related development documents linked on that page. Twitter has a very easy-to-use API with a lot of degrees of freedom". Michael has documented `rtweet` well, but reading the official documentation will really help.
This book also makes extensive use of the `tidyverse` meta-package. You will need to:
```{r eval=FALSE}
install.packages("tidyverse")
```
if you have not used packages from it before (it may take a few minutes, especially on Linux systems).