Question: Can someone tell me what I'm doing wrong? coding in R. ## Lastly, let's see survival based on just Pclass. ## First, let's make a

Can someone tell me what I'm doing wrong? coding in R.

## Lastly, let's see survival based on just Pclass. ## First, let's make a summary table for survival based on pclass. ## use dplyr to calculate the number and % of passengers who lived/died in each Pclass ---- Pclass_Table <- Titanic_Data %>% group_by(Pclass, Survived) %>% summarise(count = n()) %>% mutate(proportion = count / sum(count))

## View the summary table: Pclass_Table

## plot a stacked barchart for Pclass and Survival, where the bars are normalized to the Pclass, ---- ##...and the sections are labeled with the proportions. Give the graph a meaningful title. ## hint: this is just like we made for gender and survival (%), but now with Pclass. ggplot(Titanic_Data, aes(Pclass, fill = Survived)) + geom_bar() + geom_text(aes(label = round(proportion, 2)), position = position_stack(vjust = 0.5)) + labs(title= "Survival within Passenger Class")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!