library("readxl")
data<-read_excel("SolarPrediction(USE).xls")
radiation<-data[,1]
temperature<-data[,2]
pressure<-data[,3]
humidity<-data[,4]
windspeed<-data[,5]
m1 <- lm(formula=radiation~temperature+pressure+humidity+windspeed)
summary(m1)
Why is it when I run the m1 code does it spit out this error: Error in model.frame.default(formula = radiation ~ temperature + pressure + :
invalid type (list) for variable 'radiation'
I repeated what my professor has done many times so I am not sure why I am getting this error. Is it because I am importing an excel file?