(View source here: https://gist.github.com/mkcor/d54cc5eb4d3b826d093b)
Some informal data and graphs created for David McArthur by Tom Filloon and Ari Lamstein and Marianne Corvellec.
Made with R, RStudio, knitr, ggplot2, Hmisc and plotly. Thanks R Community for making this so easy!
# create some random data that matches with our experiences during the conference
sex <- sample(c("M", "F"), 700, prob=c(0.75, .25), T)
age <- rnorm(700, 35, 5)
continent <- sample(c("North America", "Europe", "Asia", "South America"), 700,
prob=c(.5, .3, .15, .05), T)
year_first_contact <- age
year_first_contact <- year_first_contact + 1949
year_first_contact <- year_first_contact + sample(-3:3, 700, T) # to add some jitter
affiliation <- sample(c("A", "G", "I", "S"), 700, prob=c(0.3, 0.03, 0.49, 0.18),
replace=T)
df <- data.frame(sex=sex, age=age, continent=continent,
year_first_contact=year_first_contact, affiliation=affiliation)
# force first row to be David McArthur
df[1, "sex"] <- "M"
df[1, "age"] <- 70.0
df[1, "continent"] <- "North America"
df[1, "year_first_contact"] <- 1958
df[1, "affiliation"] <- "A"
library(ggplot2)
library(Hmisc)
library(devtools)
install_github("ropensci/plotly")
library(plotly)
continent <- ggplot(df, aes(x=continent)) + geom_bar() + ggtitle("Continent of Origin")
py <- plotly()
You can view an interactive version of this plot at https://plot.ly/~mkcor/414 and get R code for it at https://plot.ly/~mkcor/414.r
py$ggplotly(continent)
## Warning: You may want to use geom_histogram.
affiliation <- ggplot(df, aes(x=affiliation)) + geom_bar() +
ggtitle("Affiliation (Academic, Government, Industry, Student)")
Again, view an interactive version of this plot at https://plot.ly/~mkcor/395
py$ggplotly(affiliation)
## Warning: You may want to use geom_histogram.
sex <- ggplot(df, aes(x=sex)) + geom_bar() + ggtitle("Sex of Attendees")
You can use the link in the iframe above and append file extensions to it, like .r, .json, .png, etc.
py$ggplotly(sex)
## Warning: You may want to use geom_histogram.
bpplot(df$age, main="Age of Attendees")
bpplot(df$year_first_contact, main="First Computer Contact")