```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(quanteda)
```

## Assumptions

When doing quantitative text analysis, we assume...

- ...That texts represent an **observable implication** of some **underlying characteristic** of interest (an attribute of the author, the subject, ...)
- ...That texts can be represented through extracting their **features**, e.g. words
- ...That we can analyze the **frequency of features** (as a *document-feature matrix*) with quantitative methods to measure these underlying characteristics

## Process

In practice, this means we move from...

**A text**

```{r}
course <- "Over the past years, the availability of new data through the digitalization of legal, political, journalistic corpora as well as the growth of online sources has allowed researchers to answer new research questions across political science.

The aim of this course is to introduce students to the quantitative analysis of textual data. We will cover both applications in recent empirical research and the implementation of text analysis techniques through hands-on experiences using the R statistical programming language.

The course will cover the collection of text data with webscraping techniques, text preprocessing, dictionaries and descriptive analysis of texts, as well as supervised and unsupervised learning methods to classify the content of text corpora."

```

to **its features**

```{r}
tokens(course)
```


**to their frequency**

```{r}
dfm(course)
```

**or their sorted frequency**

```{r}
dfm(course) %>% topfeatures()
```


...**usually, with multiple texts** 

```{r}
sessions <- c("This is a first introductory session to inform you what the course covers and to collect your previous experiences.",
"This session covers how to collect data from Webpages. We will talk about basic scraping techniques but also cover which other, more advanced techniques are out there.",
"This session dives into doing text analysis and teaches you how to describe whole collections of text as well as how to apply dictionaries to learn more about texts.",
"This session will cover classification of texts into known categories with previously coded training data.",
"This session will cover classification of texts into unknown categories based on the clustering of text.")
```

&rarr; repeat the whole procedure by yourself!

```{r}

```

