working with a data frame
x
Date Val
1/1/2012 7
2/1/2012 9
3/1/2012 20
4/1/2012 24
5/1/2012 50
a <- seq(as.Date(tai
Your data.frame a
has a column named a
. You created your model with columns named Val
and Date
so that is what its looking for.
when you make your data.frame a
name that column Date
and you're good to go:
a <- data.frame(Date=a)
Then it runs without the warning.
Per comment:
Edit your lm
call to be:
lm(Val ~ Date, data=x)