I'm trying to run a smoothing spline regression using gam for y as a function of a and b, variables in the dataset. But when I run the following code, I get the following error.
> autogam_axb <- gam(data$y~s(data$a,data$b))
Error in eval(expr, envir, enclos) : object 'a' not found
Any idea what I am doing wrong?