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. is the code written correctly per the instructions? I did install the dplyr package

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

  • is the code written correctly per the instructions?

  • I did install the dplyr package at the beginning but it still gives me the error and error about not finding %>% function.

## 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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago