Dear "R" experts / helpers,
I'm still new with "R" and will appreciate your help to solve the following issue with a lineal regression error.
Your help will be very much appreciated!
r Code#
library(ggplot2)
library(caTools)
library(caret)
wines<-(wines_SPA)
split_index <- sample.split(wines$price,SplitRatio = 0.65)
View(split_index)
train<- subset(wines,split_index==T)
test <- subset(wines,split_index==F)
View(train)
View(test)
Error
mreg<- lm(price~.,data = train, drop.unused.levels=TRUE)
Error incontrasts<-
(*tmp*
, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
Any idea what I am missing here?