Anybody fix this code?
x <- read.csv('/usercode/files/titanic.csv') y<-tapply(x$passenger>18,x$survived,mean) print(y)
Bit hard without knowing the details of the challenge, but don't you need to create a filter for passengers >=18. (adults)
The challenge is: You need to find and output the mean class value for the passengers who are adults (Age >= 18), grouped by the Survived column. So, the first step is to create a filter / dataframe which will contain the information of everybody who is an adult. Refer 26.1 of the tutorial When you have created that dataframe, you can then look for the mean of the passenger class of the survivors. Might I suggest: adults <- x[26.1] # big hint here!
Amala Yakin Review lesson 26.1
Thank u but why i post this because some concept will not understand clearly for me
x <- read.csv('/usercode/files/titanic.csv') print(x[x$passenger>18,]) but still it comes error
Problem Statement Given two integers a and b, your task is to calculate and print the following four values:
Please help, any idea?