0
Why the output is not correct?
I am trying to finish the last code project in R language, but I do not why I can not get the expected output. I can not get the correct mean https://code.sololearn.com/cOY0N3X7V9kK/?ref=app
6 Respostas
+ 2
You can approach the task like this:
1. Make a subset of the data, only keep those rows for which age is >= 18
2. Use the subset to calculate the means (with tapply)
x$Age >= 18 will not work as it only returns a vector of booleans
+ 1
x <- read.csv('/usercode/files/titanic.csv')
x <- x[x$Age >= 18, ]
tapply(x$Pclass, x$Survived, mean)
+ 1
Thank you guys,
But what is Pclass SoloProg ?
+ 1
Read the task description again: You are supposed to calculate the mean class grouped by survivial
+ 1
Lisa DM is not working: Was willst du mit 🐈
0
Kkk