After the code:
library(caTools)
sample.split(temperature$Month,SplitRatio = 0.65)-> split_model
subset(temperature, split_model==T)->train
subset(temperature, split_model==F)->test
nrow(train)
It works,
but then when I enter:
lm(Month~Country+Region+City+AvgTemperature,data=train)-> mod1
Error incontrasts<-
(*tmp*
, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
I does not work and I cleaned up the RAM;
Please could you help me?
Thank you
Sara