rfordatascience / tidytuesday

Official repo for the #tidytuesday project
Creative Commons Zero v1.0 Universal
6.76k stars 2.39k forks source link

R-Ladies Chapters Events #632

Closed Fgazzelloni closed 10 months ago

Fgazzelloni commented 11 months ago

Please fill out as much of this information as you can!

Cleaning script:

library(tidyverse)
library(jsonlite)
data <- jsonlite::fromJSON('https://raw.githubusercontent.com/rladies/meetup_archive/main/data/events.json')

chapters <- data %>%
  select(1,2,3,7,8)%>% 
  rename(chapter=group_urlname)%>%
  mutate(location=ifelse(location=="Online event","online","inperson"),
         title=sub(".*-- ","",title),
         title=gsub("\\s*\\([^\\)]+\\)","",title)) %>%
  filter(!str_detect(title,regex("canceled|cancelled",ignore_case=T)),
         !chapter%in%c("RLadiesJeddah","muhq_deleted@4633@rladies-ushuaia",
                      "muhq_deleted@9919@notopic@508502","notopic@544550"))%>%
  arrange(desc(date))%>%
  filter(year(date)<2024)%>%
  mutate(year=year(date))

# to download the n. of attendees
library(meetupr)
# meetupr::get_event_attendees("event-id")

id <- rladies_chapters$id
id1 <- id[1:25]

attendees <- function(id) {
  dat<- meetupr::get_event_attendees(id)%>%
   dim()
    dat[1]
}

mylist <- lapply(id1,attendees)

first25 <- mylist%>%unlist()
first25_events <- rladies_chapters[1:25,]%>%
  cbind(first25)

Data dictionary:

variable class description
id double event id
chapter character rladies chapter name
title character event title
date date event date
location character event location if online or in person
year double event year
tracykteal commented 10 months ago

Dataset for the week of 2023-11-21. Thanks!