Add fields argument to find_groups() to retrieve optional fields from the response. I am using this package to work on a project this summer and found out that I needed a count of past events for each R-Ladies group. Thankfully, past_event_count is an optional field within the response of find/groups API method.
For now, I suggest just adding fields to find_groups() and the call to .fetch_results() as shown below:
# add 'past_event_count' and 'upcoming_event_count' to the query parameters using 'fields' argument;
#these two are among several optional fields provided by the API: https://www.meetup.com/meetup_api/docs/find/groups/
all_rladies_groups <- find_groups(text = "r-ladies",
fields="past_event_count, upcoming_event_count", api_key = "key here")
# Cleanup
rladies_groups <- all_rladies_groups[grep(pattern = "rladies|r-ladies|r ladies",
x = all_rladies_groups$name,
ignore.case = TRUE), ]
#for now, we could easily retrieve the values for these two fields with:
pastevent_count <- purrr::map_dbl(rladies_groups$resource, "past_event_count", .default = 0)
upcomingevent_count <- purrr::map_dbl(rladies_groups$resource, "upcoming_event_count", .default = 0)
Add
fields
argument tofind_groups()
to retrieve optional fields from the response. I am using this package to work on a project this summer and found out that I needed a count of past events for each R-Ladies group. Thankfully,past_event_count
is an optional field within the response offind/groups
API method.For now, I suggest just adding
fields
to find_groups() and the call to.fetch_results()
as shown below:An example usage could be: