Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

8. Design office space to facilitate interaction between employees.

Answered: 1 week ago