Survival of passengers on the Titanic

knitr::opts_chunk$set(echo = TRUE)

Note: The descriptions has been taken from R.

Description

This data set provides information on the fate of passengers on the fatal maiden voyage of the ocean liner ‘Titanic’, summarized according to economic status (class), sex, age and survival.

Usage

Titanic

Format

A 4-dimensional array resulting from cross-tabulating 2201 observations on 4 variables. The variables and their levels are as follows:

Variable | Levels -------------|--------------------------------------------------------------------------------------- Class | 1st, 2nd, 3rd, Crew Sex | Male, Female Age | Child, Adult Survived | No, Yes

Source

The source provides a data set recording class, sex, age, and survival status for each person on board of the Titanic, and is based on data originally collected by the British Board of Trade and reprinted in:

Full data set

To create a data set with all 2201 observations and 4 variables run

titanic <- as.data.frame(Titanic)
index   <- rep(1:nrow(titanic), titanic$Freq)
titanic <- titanic[index, -5] # exclude Freq
str(titanic)


Try the rmdwc package in your browser

Any scripts or data that you put into this service are public.

rmdwc documentation built on Nov. 13, 2022, 1:07 a.m.