Summarizing user types
Since you can use the count() wrapper, why bother counting rows in a group as part of a grouped summary? Sometimes you want a more detailed summary, and knowing how to compute a count as part of a grouped summary that mixes numeric and categorical summaries can come in handy.
Diese Übung ist Teil des Kurses
Introduction to Text Analysis in R
Anleitung zur Übung
- Group
twitter_databy whether or not a user is verified. - Compute the average number of followers for each type of user. Call this new column
avg_followers. - Count the number of verified and non-verified users. For consistency, call this new column
n.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
library(tidyverse)
twitter_data %>%
# Group by whether or not a user is verified
___(___) %>%
summarize(
# Compute the average number of followers
___ = ___,
# Count the number of users in each category
___ = ___
)