knitr::opts_chunk$set(echo = TRUE) library(knitr) library(RUGtools)
This is a traditional ioslides R Markdown template, but modified to contain default content routinely used when introducing Chicago R user group meetups.
Slides are useful because they look good and you won't forget to do important things
like thanking the sponsors! Slides can be accessed from within R Studio
using the New R Markdown
dialog menu, and then selecting From Template
.
One can also use the draft
function, exemplified below.
rmarkdown::draft(file="new_meetup.Rmd", template = "intro_slides", package="RUGtools")
In Chicago, we think a lot about Pizza. And if one is involved in the local meetup
culture, this is doubly so. At a recent meetup group that wasn't ours, I counted
nearly 6 large pizzas left over. Struck by an overwhelming sorrow, I vowed the
Chicago R User Group shall never partake in such a tragic waste of resources.
With a few data points, one can use the pizza_estimate
function to arrive at
a more efficient order.
kable( pizza_estimate(registered = 120, pizza_diameter = 18, attend_rate = 0.57, serving = 2, style = "thin") )
Channeling our ever-curious pizza scientist, it turns out the Chicago "party cut" (thin-crust cut into small squares) inherits a few very attractive properties when dividing p pizzas among n guests. Small square pieces allow guests to better estimate pizza consumption, thus decreasing the integer-programming problem exacerbated by large triangular slices. Reducing wasted pizza is not only virtuous, it demonstrates great stewardship of sponsor resources bestowed upon thee.
plot(3.1*c(1, 0, -1, 0), 3.1*c(0, 1, 0, -1) , col = "transparent", xaxs="i", yaxs="i", xaxt="n", yaxt="n", ylab="18 inches", xlab="18 inches", main = "The Chicago `Party Cut` Extra-Large Pizza", bg = "white", axes = 0) polygon(3*sin(seq(0, 2*pi, length=100)), 3*cos(seq(0, 2*pi, length=100)), border = "goldenrod2", lwd=6, col = "lightgoldenrod1") polygon(2.85*sin(seq(0, 2*pi, length=100)), 2.85*cos(seq(0, 2*pi, length=100)), border = "goldenrod1", lwd=16, col = "lightgoldenrod1") points(x=jitter(c((1:4)-2.5, seq(from = -2, to =2, length.out=6), (1:6)-3.5, (1:6)-3.5, seq(from = -2, to =2, length.out=6), (1:4)-2.5), factor = 2), y=jitter(c(rep(2.75,4), rep(1.85, 6), rep(1,6), rep(0,6), rep(-0.85, 6), rep(-1.75,4))-0.5, factor=1), pch=19, cex=4, col="red") points(x=jitter(c((1:4)-2.5, seq(from = -2, to =2, length.out=6), (1:6)-3.5, (1:6)-3.5, seq(from = -2, to =2, length.out=6), (1:4)-2.5), factor = 2), y=jitter(c(rep(2.6,4), rep(1.85, 6), rep(1,6), rep(0,6), rep(-0.85, 6), rep(-1.6,4))-0.5, factor = 2), pch="`", cex=4, col="darkgreen") points(x=jitter(c(seq(from=-1.5, to=1.5, length.out=12), seq(from = -2, to =2, length.out=18), seq(from=-3, to=3, length.out=24), seq(from=-3, to=3, length.out=24), seq(from = -2, to =2, length.out=18), seq(from=-1.5, to=1.5, length.out=12)), factor = 2), y=jitter(c(rnorm(12, mean = 3, sd=0.5), rnorm(18, mean = 2, sd=0.5), rnorm(24, mean = 1, sd=0.5), rnorm(24, mean = 0, sd=0.5), rnorm(18, mean = -1, sd=0.5), rnorm(12, mean = -2, sd=0.5))-0.5, factor=2), pch=".", cex=1.5, col="black") abline(h=seq(from=-3.1, to=3.1, length.out=7), col="white", lwd=2.5) abline(v=seq(from=-3.1, to=3.1, length.out=6), col="white", lwd=2.5)
Chicago R User Group data is included and downloaded from meetup.com/ChicagoRUG. Personally identifiable information has been removed, data formatted and ready for analysis.
Load the member list data. How many members do we have?
nrow(member_list)
Lets plot the cumulative membership.
plot(y = member_list$Member.ID, x = member_list$Joined.Group.on, type = "l", lwd=2, col = "blue", frame = FALSE, main = "Chicago R User Group members", ylab = "Members", xlab = "", ylim = c(0, 4000), xlim=c(min(member_list$Joined.Group.on), as.Date("2020-01-01")))
How many members joined since January 2017?
nrow(subset(member_list, Joined.Group.on > "2017-01-01"))
What percentage of the Chicago R User Group joined since January 2017?
Percentage <- 100 * NROW(subset(member_list, Joined.Group.on > "2017-01-01")) / NROW(member_list) round(Percentage, 2)
First, get a unique ordered list of Meetup dates
Meetup_dates <- sort(unique(member_list$Last.Attended)) new_members <- subset(member_list, Joined.Group.on > Meetup_dates[NROW(Meetup_dates)])
Then count the number of new members joined between the most recent meetup and the one prior to that.
new_members2 <- subset(member_list, Joined.Group.on <= Meetup_dates[NROW(Meetup_dates)] & Joined.Group.on > Meetup_dates[NROW(Meetup_dates)-1]) nrow(new_members2)
In danger of repeating the above analysis several times over, we created a function new_mem_counter
to count the number of new members joined between meetups for
all meetups in the data set.
new_members <- new_mem_counter(member_list) # drop the last observation, as incomplete data leading up to the coming meetup. new_members <- new_members[-NROW(new_members),] kable(head(new_members), align = 'l') kable(tail(new_members), align = 'l')
Which gap between meetups had the most new members?
kable(new_members[new_members$New==max(new_members$New), ], align = 'l')
Note the previous meetup was 6 months prior, so likely this was not due to the topic covered.
What is the average number of new members joined between meetups?
mean(new_members$New)
Plot the new members
data.
# Create Date Range Index Date_Index <- as.numeric(row.names(new_members[new_members$Date > "2010-01-01" & new_members$Date <= Sys.Date(),])) # Create x-axis labels, using year-month date format x_labels <- format(new_members$Date[Date_Index], "%Y-%m") # Plot barplot(new_members$New[Date_Index], names.arg = x_labels, main = "CRUG members, joined between meetups", ylab = "New Members", xlab = "")
Plot the new members
data since 2017.
# Create Date Range Index Date_Index <- as.numeric(row.names(new_members[new_members$Date > "2017-01-01" & new_members$Date <= Sys.Date(),])) x_labels <- format(new_members$Date[Date_Index], "%Y-%m") # Plot barplot(new_members$New[Date_Index], names.arg = x_labels, las=2, main = "CRUG members, joined between meetups", ylab = "New Members", xlab = "")
What is the average number of new members joined between meetups since 2017?
mean(new_members$New[Date_Index])
Load and use the xts
package.
library(xts) members_xts <- xts(x = member_list$Member.ID, order.by = member_list$Joined.Group.on) names(members_xts) <- "useRs" plot(members_xts, col = "blue", grid.col = "white", main = "Chicago R User Group members by join date")
members_monthly <- to.monthly(members_xts, OHLC = FALSE) barplot(diff(members_monthly), col = "lightgrey", main = "Chicago R User Group, new members by month")
Omit the first two months growth outliers.
barplot(100*diff(members_monthly)[-c(1,2)]/members_monthly[-c(1,2)], col = "lightgrey", main = "CRUG Growth since inception", ylab="Percent")
Let's view the last 4 years.
members_3_years <- 100*diff(members_monthly["2015-05/"]) / members_monthly["2015-05/"] barplot(members_3_years, col = "lightgrey", main = "CRUG Growth, last 4 years", ylab="Percent")
Consider seasonal variation.
month_percent_growth <- c(NA, NA, NA, NA, 100*diff(log(coredata(members_monthly))), NA, NA, NA, NA, NA, NA, NA) seasonal_matrix <- matrix(month_percent_growth, ncol = 12, byrow = TRUE) colnames(seasonal_matrix) <- month.abb rownames(seasonal_matrix) <- 2010:2019 seasonal_matrix <- rbind(seasonal_matrix, Median=round(apply(seasonal_matrix, 2, median, na.rm=TRUE), 2)) kable(seasonal_matrix, digits=2, caption = "Percentage Growth per Month")
As one of the largest and oldest R
user groups in existence, the Chicago R
User Group has matured into a comfortable period of value. Growth rates are lower by percentage, but the group continues to serve a steady group of new useR
s.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.