Dataset Source

For this assignment, I plan to use the Titanic dataset from the Seaborn public GitHub repository. The dataset is available as a public CSV file, which will allow the R code to load it directly from the internet.

Dataset Description

The dataset contains information about 891 Titanic passengers, including whether each passenger survived, passenger class, sex, age, fare, family relationships, and embarkation location. The survived column will be treated as the target variable.

Motivation and Approach

I selected this dataset because I am interested in understanding how passenger characteristics may relate to survival. I loaded the dataset into R, selected a useful subset of columns, renamed abbreviated columns, and replaced numerical category values with understandable labels.

Anticipated Data Challenges

Some passenger information, particularly age and deck, is missing. I will select columns carefully and make sure that the final column names and values are clear and meaningful.

Loading the Dataset

I loaded the original Titanic CSV file directly from its public GitHub URL so that the analysis can be reproduced without using a file stored on my computer.

titanic_data <- read.csv("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/titanic.csv")
head(titanic_data)
##   survived pclass    sex age sibsp parch    fare embarked class   who
## 1        0      3   male  22     1     0  7.2500        S Third   man
## 2        1      1 female  38     1     0 71.2833        C First woman
## 3        1      3 female  26     0     0  7.9250        S Third woman
## 4        1      1 female  35     1     0 53.1000        S First woman
## 5        0      3   male  35     0     0  8.0500        S Third   man
## 6        0      3   male  NA     0     0  8.4583        Q Third   man
##   adult_male deck embark_town alive alone
## 1       True      Southampton    no False
## 2      False    C   Cherbourg   yes False
## 3      False      Southampton   yes  True
## 4      False    C Southampton   yes False
## 5       True      Southampton    no  True
## 6       True       Queenstown    no  True

Selecting and Transforming Columns

I selected the columns most relevant to understanding passenger survival. I also renamed abbreviated columns and changed numerical category values into labels that are easier to understand.

titanic_clean <- titanic_data[c(
  "survived", "pclass", "sex", "age",
  "sibsp", "parch", "fare", "embark_town"
)]

names(titanic_clean) <- c(
  "survival_status", "passenger_class", "sex", "age",
  "siblings_spouses", "parents_children",
  "ticket_fare", "embarkation_city"
)

titanic_clean$survival_status <- ifelse(
  titanic_clean$survival_status == 1,
  "Survived",
  "Did Not Survive"
)

titanic_clean$passenger_class <- factor(
  titanic_clean$passenger_class,
  levels = c(1, 2, 3),
  labels = c("First Class", "Second Class", "Third Class")
)

head(titanic_clean)
##   survival_status passenger_class    sex age siblings_spouses parents_children
## 1 Did Not Survive     Third Class   male  22                1                0
## 2        Survived     First Class female  38                1                0
## 3        Survived     Third Class female  26                0                0
## 4        Survived     First Class female  35                1                0
## 5 Did Not Survive     Third Class   male  35                0                0
## 6 Did Not Survive     Third Class   male  NA                0                0
##   ticket_fare embarkation_city
## 1      7.2500      Southampton
## 2     71.2833        Cherbourg
## 3      7.9250      Southampton
## 4     53.1000      Southampton
## 5      8.0500      Southampton
## 6      8.4583       Queenstown

Conclusions and Next Steps

The Titanic dataset was successfully loaded from a public online source and transformed into a data frame containing eight clearly named columns. The survival and passenger-class values were also changed into labels that are easier to understand. I could extend this work by comparing survival rates across passenger class, sex, and age. Before drawing conclusions, I would also examine how the missing age values might affect the results.

Generative AI Use

OpenAI. (2026). ChatGPT (GPT-5) [Large language model]. https://chatgpt.com. Accessed September 5, 2026.