How many R-Ladies chapter are out there?
We can use the find_groups() function to search for
groups with “r-ladies” in their name. Note that the function returns up
to 200 results, so we will filter them afterwards.
meetup_groups <- find_groups("r-ladies")
meetup_groupsSince the search might return groups that are not actually R-Ladies chapters, we will filter them by name.
Now, while searching for R-Ladies chapters is a nice way to get
started, a more reliable way is to use the get_pro_groups()
function, which retrieves all the official R-Ladies chapters. Since
R-Ladies is a pro organization on meetup.com, we can use this function
to get the list of all chapters that are part of the R-Ladies
network.
rladies_pro <- get_pro_groups("rladies")Growth
Let us now visualize the growth of R-Ladies chapters over time.
df <- rladies_pro |>
mutate(
dategroup = format(founded_date, "%Y-%m")
) |>
group_by(dategroup) |>
tally() |>
mutate(
cum_sum = cumsum(n)
)
ggplot(
data = df,
aes(x = dategroup, y = cum_sum)
) +
geom_bar(
stat = "identity",
color = "#88398A",
fill = "#88398A"
) +
theme_bw() +
labs(
title = "Growth of R-Ladies chapters",
caption = "Data from meetup.com via the meetupR package",
x = "",
y = "Number of chapters"
) +
theme(
axis.text.x = element_text(angle = 45, vjust = 1, hjust = 1)
) +
scale_x_discrete(
breaks = df$dategroup[seq(1, length(df$dategroup), by = 2)]
)Chapter activity
Let us now extract the number of past events and the dates of last and next events, for each chapter.
rladies_events <- get_pro_events("rladies")
event_summary <- rladies_events |>
group_by(group_name, group_urlname) |>
summarise(
n_past = ifelse("PAST" %in% status, length(status), 0),
last_event = ifelse(
"PAST" %in% status,
format(max(date_time[status == "PAST"]), "%Y-%m-%d"),
NA
),
next_event = ifelse(
"ACTIVE" %in% status,
format(min(date_time[status == "ACTIVE"]), "%Y-%m-%d"),
NA
)
)
event_summaryWhich chapters have never had events and have not even planned one (and have been created more than 6 months ago)?
rladies <- rladies_pro |>
rename(group_urlname = urlname) |>
left_join(event_summary, by = "group_urlname")
rladies |>
filter(
n_past == 0,
is.na(next_event),
founded_date < Sys.Date() - 6 * 30
) |>
arrange(founded_date)Which chapters had no events in the past 6 months and have not even planned one?
rladies |>
filter(
last_event < as.POSIXct("2019-03-29"),
is.na(next_event)
) |>
arrange(last_event)Wordcloud of events
Finally, let us create a wordcloud of the most common words in the event descriptions of all R-Ladies chapters.
# Strip html tags from event descriptions
strip_html <- function(x) {
sapply(x, function(x) {
gsub("<[^>]+>", "", x)
})
}
#' custom function to create wordcloud data
rladies_wc <- function(data, column, n = 100) {
data |>
unnest_tokens(word, {{ column }}) |>
anti_join(stop_words, by = "word") |>
filter(
!grepl("^[0-9]+$", word),
nchar(word) > 2,
!word %in% c("p", "br", "href", "http", "https", "class", "www", "com"),
!word %in%
c(
"de",
"la",
"et",
"les",
"des",
"le",
"en",
"un",
"une",
"du",
"para",
"con",
"del",
"el",
"se",
"y",
"los",
"es"
)
) |>
count(word, sort = TRUE) |>
slice_max(n, n = n) |>
ggplot(aes(
label = word,
size = n,
color = n
)) +
geom_text_wordcloud() +
scale_size_area(max_size = 12) +
scale_color_gradient(
low = "#88398A",
high = "#562457"
) +
theme_minimal()
}
rladies_wc(rladies_events, description) +
labs(
title = "Most common words in R-Ladies event descriptions",
caption = "Data from meetup.com via the meetupr package"
)