It would have made this question a lot easier to answer if you had provided some sample data.
Checking the names
of the object isn't a good way of finding out what is inside it. Try running str(fit)
and you'll see what you are missing.
The fitted.values
object is nested one level deeper.
library(mgcv)
library(caret)
dat <- gamSim(1,n=400,dist="normal",scale=2)
test<-train(y~x1, data=dat, method='gam') # Next time, provide any data like this.
test$finalModel$fitted.values # If that isn't what you want, try str(test)