R: numeric 'envir' arg not of length one in predict()
问题 I'm trying to predict a value in R using the predict() function, by passing along variables into the model. I am getting the following error: Error in eval(predvars, data, env) : numeric 'envir' arg not of length one Here is my data frame , name df: df <- read.table(text = ' Quarter Coupon Total 1 "Dec 06" 25027.072 132450574 2 "Dec 07" 76386.820 194154767 3 "Dec 08" 79622.147 221571135 4 "Dec 09" 74114.416 205880072 5 "Dec 10" 70993.058 188666980 6 "Jun 06" 12048.162 139137919 7 "Jun 07"