Please anyone solve this. | Sololearn: Learn to code for FREE!


Please anyone solve this.

You are working on the Titanic Survivors data set, which includes information on the passengers of the ship. The data is stored in a CSV file, which is already imported in the given code. You want to understand how the class of the ticket impacted the survival rate. For that, you need to find and output the mean class value for the passengers who are adults (Age >= 18), grouped by the Survived column.

9/15/2021 4:28:24 PM

Ammara Tayyab

7 Answers

New Answer


Reassign to x when subsetting: x <- x[x$Age >= 18,] (You have a typo for Age) This way, only the rows with Age >= 18 will be kept in x and used for calculating the mean :)


Ammara Tayyab , the community is willing to help you. but before we can do this, we like to see your code first. please post it here. thanks!


Please show your code. Similar question here:


Lothar Now where is the error in the program? x <- read.csv('/usercode/files/titanic.csv') x[x$age >= 18, ] tapply(x$Pclass, x$Survived, mean)


Thank you Lisa. It worked.


Hello dear


Visit kaggle website you can find dataset as well as source code take a reference