How do I access the p-values of individual predictors using caret::train? I can't figure out how to access the p-values for my predictor variables after using k-fold cross-validation with caret::train. Does anyone know? Below is an example using the Boston data set that comes with the ISLR2 library:
library(caret)
library(ISLR2)

Boston <- na.omit(Boston)

trainControl <- trainControl(method="cv", number = 10, savePred = T)

model <- train(medv ~ . -rad -tax -lstat + poly(lstat, 5), data = Boston, trControl = trainControl, method = "lm")

If I now call print(model), R will return the RMSE, R^2, and MAE for the cross-validated model. If I call model$finalModel, R will return the coefficients for the individual predictor variables. But I can't figure out how to get the p-values for those predictor variables. I can call summary(model), but my understanding is that summary() is not returning the information aggregate about the 10 cross-validated models, but rather is returning information about only 1 of the 10 models (maybe the last one?). Does anyone know the answer here? Is there some other way to access the p-values for the cross-validated model? Or am I wrong about summary(), and calling summary() actually giving me information about the cross-validated model?

This may be what you're after:
summary(model$finalModel)

