0

titanic surviving test

i have a problem my output is logical(0) this is my code but i still dont what is the problem x <- x[x$age >= 18, ] res<-by(x$Pclass, x$Survived, mean) print(res)

26th Sep 2021, 11:43 AM
Amirreza Farahani
Amirreza Farahani - avatar
3 Respostas
+ 1
Use tapply instead of by, and don't assign to res and don't use print, and also remember to read the csv file and assign it to x.
26th Sep 2021, 11:53 AM
Jan
Jan - avatar
+ 1
It is Age with capital A. And, as already mentioned, try tapply()
26th Sep 2021, 12:35 PM
Lisa
Lisa - avatar
+ 1
Lisa Yes, that's rigth with capital A.
26th Sep 2021, 12:46 PM
Jan
Jan - avatar