0
Anybody fix this code?
x <- read.csv('/usercode/files/titanic.csv') y<-tapply(x$passenger>18,x$survived,mean) print(y)
5 ответов
+ 2
Bit hard without knowing the details of the challenge, but don't you need to create a filter for passengers >=18. (adults)
+ 2
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!
+ 1
Amala Yakin
Review lesson 26.1
0
Thank u but why i post this because some concept will not understand clearly for me
0
x <- read.csv('/usercode/files/titanic.csv')
print(x[x$passenger>18,]) but still it comes error