LoslegenKostenlos loslegen

Practicing with grouped summaries

We can use pivot_wider() in association with the output of grouped summaries as well.

Diese Übung ist Teil des Kurses

Introduction to Text Analysis in R

Kurs anzeigen

Anleitung zur Übung

  • Append tidy_twitter to the afinn sentiment dictionary.
  • Group by both complaint label and whether or not the user is verified.
  • Summarize the data to create a new column, aggregate_value, which contains the sum of value.
  • Spread the complaint_label and aggregate_value columns.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

tidy_twitter %>% 
  # Append the afinn sentiment dictionary
  ___(___) %>% 
  # Group by both complaint label and whether or not the user is verified
  ___(___) %>% 
  # Summarize the data with an aggregate_value = sum(value)
  ___(___) %>% 
  # Spread the complaint_label and aggregate_value columns
  ___(___) %>% 
  mutate(overall_sentiment = Complaint + `Non-Complaint`)
Code bearbeiten und ausführen