Import packages
library(tidytext)
library(dplyr)
Create data for analysis
text <- "Dplyr provides the ability to process and wrangle data, facilitating convenient data transformations through functions like arrange, select and mutate."
data <- data.frame(count = 5, text)
data$text <- as.character(data$text)
Tokenize text
tokenize <- data %>% unnest_tokens(word, text)
head(tokenize, 10)
## count word
## 1 5 dplyr
## 1.1 5 provides
## 1.2 5 the
## 1.3 5 ability
## 1.4 5 to
## 1.5 5 process
## 1.6 5 and
## 1.7 5 wrangle
## 1.8 5 data
## 1.9 5 facilitating