Skip to content

Instantly share code, notes, and snippets.

@MaximePawlakFr
Created May 31, 2017 16:10
Show Gist options
  • Save MaximePawlakFr/382371ab80efbeb01811213d86994ea5 to your computer and use it in GitHub Desktop.
Save MaximePawlakFr/382371ab80efbeb01811213d86994ea5 to your computer and use it in GitHub Desktop.
# Let's read a file and see what is inside
who = read.csv("WHO.csv")
str(who)
summary(who)
# Divide and Conquer !
who_europe = subset(who, Region == "Europe")
which.min(who$Under15)
# Drawing is fun
plot(whi$GNI, who$FertilityRate)
# I told you, I wanted to divide !
outliers = subset(who, GNI > 10000 & FertilityRate > 2.5)
nrow(outliers)
# Draw again
hist(who$CellularSubscribers)
boxplot(who$LifeExpectancy ~ who$Region)
table(who$Region)
table(who$Over60, who$Region, mean)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment