Hi, I'm try to plot a data static but I cannot find where exactly errors happen
var <- c("PassengerId","Survived","Pclass","Sex","Age","SibSp","Parch","Fare")
static_titanic <- titanic[,var]
aggregate(static_titanic[,2:8],list(static_titanic$Sex),mean)
aggregate(static_titanic[,2:8],list(static_titanic$Sex),median)
aggregate(static_titanic[,2:8],list(static_titanic$Sex),sd)
It displays errors such as:
=> aggregate(static_titanic[,2:8],list(static_titanic$Sex),mean)
Warning messages:
1: In mean.default(X[[i]], ...) :
argument is not numeric or logical: returning NA
2: In mean.default(X[[i]], ...) :
argument is not numeric or logical: returning NA
=> aggregate(static_titanic[,2:8],list(static_titanic$Sex),median)
Warning message:
In mean.default(sort(x, partial = half + 0L:1L)[half + 0L:1L]) :
argument is not numeric or logical: returning NA
=> aggregate(static_titanic[,2:8],list(static_titanic$Sex),sd)
Warning messages:
1: In var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm) :
NAs introduced by coercion
2: In var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm = na.rm) :
NAs introduced by coercion