I cannot understand what is going wrong here.
data.train <- read.table("Assign2.WineComplete.csv",sep=",",header=T)
# Building decision tree
Train <- data.frame(residual.sugar=data.train$residual.sugar,
total.sulfur.dioxide=data.train$total.sulfur.dioxide,
alcohol=data.train$alcohol,
quality=data.train$quality)
Pre <- as.formula("pre ~ quality")
fit <- rpart(Pre, method="class",data=Train)
I am getting the following error :
Error in eval(expr, envir, enclos) : object 'pre' not found
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…