i am trying to plot my decision tree, but it keeps giving me this error, and i can not figure out what is wrong.
here's the code:
install.packages("foreign")
library("foreign")
install.packages("C50")
library(C50)
setwd("C:\\Users\\hp\\Music\\SefSec_2014_HH_weight new.sav")
df <- read.spss("C:\\Users\\hp\\Music\\SefSec_2014_HH_weight new.sav", to.data.frame = TRUE)
View(df)
summary(df)
#summary(df$C12_21)
controlFactor = C5.0Control(sample=0.7,seed=10,CF=0.25,winnow = TRUE ,minCases = 20)
model = C5.0(df[,c(427,432,437,422,447,452,457,462,467,472,482,487,477,492,497,502,503,504,505,506,507,508)], df[,512], control = controlFactor)
na.omit(df)
summary(model)
plot(model,type="s",main="Descision Tree")
and here's the error:
> plot(model,type="s",main="Descision Tree")
Error in FUN(X[[i]], ...) : Variable match was not found.