Tanushree /Titanic Assignment
24 sep 2017
For more details on authoring R presentations please visit https://support.rstudio.com/hc/en-us/articles/200486468.
Titanic=read.csv("Titanic Data.csv")
dim(Titanic)
[1] 889 8
How many passengers survived the sinking of the Titanic?
sum(Titanic$Survived==1)
[1] 340
nrow(subset(Titanic,Survived==1))
[1] 340
attach(Titanic)
length(which(Titanic$Survived==1))
[1] 340
Create a one-way contingency table summarizing the Titanic passengers based on how many survived and how many died
Error in factor(Titanic.df$Survived, levels = c(0, 1), labels = c("Died", :
object 'Titanic.df' not found