All Titanic data sampled from
Kaggle's Machine Learning demo
This could be one line of code,
but it would run off my slide.
url <- "http://choens.github.io/titanic/public/data/passengers.csv"
passengers <- read.csv(file = url)
> dim(passengers)
> str(passengers)
Hint: Answers on next slide
> dim(passengers)
[1] 250 13
> str(passengers)
'data.frame': 250 obs. of 13 variables:
$ passenger_id : int 104 551 540 890 762 567 9 205 587 442 ...
$ survived : int 0 1 1 1 0 0 1 1 0 0 ...
$ passenger_class : int 3 1 1 1 3 3 3 3 2 3 ...
$ passenger_name : Factor w/ 250 levels "Abbing, Mr. Anthony",..: 118 217 70 26 168 209 121 46 113 88 ...
$ sex : Factor w/ 2 levels "female","male": 2 2 1 2 2 2 1 2 2 2 ...
$ age : num 33 17 22 26 41 19 27 18 47 20 ...
$ child : int 0 1 0 0 0 0 0 0 0 0 ...
passengers
in the current R sessionimport-passengers.R