Polaritate Bing tidy: Cheamă-mă Ishmael (cu ggplot2)!
Ultimul exercițiu cu lexiconul Bing! În acest exercițiu vei folosi operatorul pipe (%>%) pentru a crea o cronologie a sentimentului din Moby Dick.
În final, vei crea și o vizualizare simplă urmând structura de cod de mai jos. Capitolul următor aprofundează subiectul vizualizărilor.
ggplot(pivoted_data, aes(index_column, polarity_column)) +
geom_smooth(se = FALSE)
Acest exercițiu face parte din cursul
Analiza sentimentelor în R
Exercițiu interactiv practic
Încearcă acest exercițiu completând acest cod de exemplu.
moby_polarity <- moby %>%
# Inner join to lexicon
___(bing, by = c("___" = "___")) %>%
# Count the sentiment scores
___(___, ___) %>%
# Pivot the sentiment into positive and negative columns
___(names_from = ___, values_from = ___, values_fill = ___) %>%
# Add polarity column
mutate(___ = ___ - __) %>% arrange(index)
# Examine a portion
moby_polarity[190:195,]