Skip to content

Instantly share code, notes, and snippets.

View gabrielflorit's full-sized avatar

Gabriel Florit gabrielflorit

View GitHub Profile
@djhocking
djhocking / dplyr-select-names.R
Last active February 28, 2022 19:08
Select columns by vector of names using dplyr
one <- seq(1:10)
two <- rnorm(10)
three <- runif(10, 1, 2)
four <- -10:-1
df <- data.frame(one, two, three)
df2 <- data.frame(one, two, three, four)
str(df)
@finiterank
finiterank / Gender Parity
Last active August 29, 2015 14:02
Gender Parity Plot
library(plyr)
library(reshape2)
library(ggplot2)
edx <- read.csv("data//HMXPC13_DI_v2_5-14-14.csv")
#Gender parity by Country
gender.table <- ddply(edx, .(final_cc_cname_DI, gender), summarise, number = length(userid_DI))
levels(gender.table$gender) <- c("none", "female", "male", "other")