-
Notifications
You must be signed in to change notification settings - Fork 10
/
intro.rmd
61 lines (39 loc) · 2.88 KB
/
intro.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
# Introduction
## Overview
Dealing with text is typically not even considered in the applied statistical training of most disciplines. This is in direct contrast with how often it has to be dealt with prior to more common analysis, or how interesting it might be to have text be the focus of analysis. This document and corresponding workshop will aim to provide a sense of the things one can do with text, and the sorts of analyses that might be useful.
### Goals
The goal of this workshop is primarily to provide a sense of common tasks related to dealing with text as part of the data or the focus of analysis, and provide some relatively easy to use tools. It must be stressed that this is only a starting point, a hopefully fun foray into the world of text, not definitive statement of how you *should* analyze text. In fact, some of the methods demonstrated would likely be too rudimentary for most goals.
Additionally, we'll have exercises to practice, but those comfortable enough to do so should follow along with the in-text examples. Note that there is more content here than will be covered in a single workshop.
### Prerequisites
The document is for the most part very applied in nature, and doesn't assume much beyond familiarity with the R statistical computing environment. For programming purposes, it would be useful if you are familiar with the [tidyverse](https://www.tidyverse.org/), or at least <span class="pack">dplyr</span> specifically, otherwise some of the code may be difficult to understand (and is required if you want to run it).
Here are some of the packages used in this document:
- Throughout
- <span class="pack">tidyverse</span>
- <span class="pack">tidytext</span>
- Strings
- <span class="pack">stringr</span>
- <span class="pack">lubridate</span>
- Sentiment
- <span class="pack">gutenbergr</span>
- <span class="pack">janeaustenr</span>
- POS
- <span class="pack">openNLP</span>
- <span class="pack">NLP</span>
- <span class="pack">tm</span>
- Topic Models
- <span class="pack">topicmodels</span>
- <span class="pack">quanteda</span>
- Word Embedding
- <span class="pack">text2vec</span>
Note the following color coding used in this document:
- <span class="emph">emphasis</span>
- <span class="pack">package</span>
- <span class="func">function</span>
- <span class="objclass">object/class</span>
- [link]()
## Initial Steps
0. Download the zip file [here](https://github.com/m-clark/text-analysis-with-R/raw/master/workshop_project.zip). It contains an RStudio project with several data files that you can use as you attempt to replicate the analyses. Be mindful of where you put it.
1. Unzip it. Be mindful of where you put the resulting folder.
2. Open RStudio.
3. File/Open Project and navigate to and click on the blue icon in the folder you just created.
4. Install any of the above packages you want.