Hi,
I am running a chaid tree using titanic dataset (see attachment)
setwd("C:/Users/miguel")
titanic <- read.csv("train.csv")
titanic.s <- subset( titanic, select = -c(PassengerId, Name ) )
ctrl <- chaid_control(minsplit = 20, minbucket = 5, minprob = 0)
chaidTitanic <- chaid(Survived ~ ., data = titanic, control = ctrl)
It looks like I get the following error
Error: is.factor(x) is not TRUE
can you please help me here? I am not able to follow this type of error.
Thanks
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL:
<https://stat.ethz.ch/pipermail/r-help-es/attachments/20160821/79895191/attachment-0001.html>
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: train.csv
Type: application/vnd.ms-excel
Size: 59518 bytes
Desc: train.csv
URL:
<https://stat.ethz.ch/pipermail/r-help-es/attachments/20160821/79895191/attachment-0001.xlb>
Do factor(Survived) when calling chaid(...) Best, Jorge.- On Sunday, August 21, 2016, MIKE DE LA HOZ <miguelhoz en hotmail.com> wrote:> Hi, > > > I am running a chaid tree using titanic dataset (see attachment) > > > > setwd("C:/Users/miguel") > > titanic <- read.csv("train.csv") > titanic.s <- subset( titanic, select = -c(PassengerId, Name ) ) > > ctrl <- chaid_control(minsplit = 20, minbucket = 5, minprob = 0) > chaidTitanic <- chaid(Survived ~ ., data = titanic, control = ctrl) > > > > It looks like I get the following error > > Error: is.factor(x) is not TRUE > > > can you please help me here? I am not able to follow this type of error. > > > Thanks > > >-- Sent from my phone. Please excuse my brevity and misspelling. [[alternative HTML version deleted]]