Code

Lees de woorden en stopwoorden

setwd("~/Downloads")

#Read the data
data <-read_csv("./text_analysis_wapp.csv")

#Read stopwoorden
stopwoorden <- read_csv("./stopwoorden.csv") %>%
  pull()

stopwoorden <- c(stopwoorden, "media", "weggelaten", "nee")

Voor iedereen samen

data <- data %>%
  unnest_tokens(word, Text) %>%
  count(word, sort = T) %>%
  mutate(total = sum(n), 
         rank = row_number(),
         `term frequency` = n/total) %>%
  filter(!is.element(word, stopwoorden), str_count(word) > 1, is.na(as.numeric(word))) 
## Warning in mask$eval_all_filter(dots, env_filter): NAs introduced by coercion
wordcloud(data$word, data$n, max.words = 150)

Per persoon

#Read the data
data <-read_csv("./text_analysis_wapp.csv")
vaag <- c("+31 6 18866181", "16")

data2 <- data %>%
  unnest_tokens(word, Text) %>%
  group_by(Naam) %>%
  count(word, sort = T) %>%
  mutate(total = sum(n), 
         rank = row_number(),
         `term frequency` = n/total) %>%
  filter(!is.element(word, stopwoorden), str_count(word) > 1, is.na(as.numeric(word))) %>%
  filter(!is.element(Naam, vaag))
for(i in 1:length(unique(data2$Naam))){
  
  print(unique(data2$Naam)[i])
  
  df <- data2 %>%
    filter(Naam == unique(data2$Naam)[i]) %>%
    ungroup() %>%
    mutate(freq = n) %>%
    select(word, freq)
  
  wordcloud(df$word, df$freq, max.words=150)
    
}
## [1] "Wim Leferink Op Reinink"

## [1] "Bas Machielsen"

## [1] "Marc De Rode"

## [1] "Thijs Hilberdink"

## [1] "Julius Kuit"

## [1] "Erik Emondt"

## [1] "Jelle Heuver"

## [1] "Mitch"

## [1] "Julian Boer"

## [1] "Yorick Karseboom"

## [1] "Daan van der Zwaag"