How to pass customized formula to learing_curve_dat of caret?

train(mpg ~ wt+cyl,
      mtcars,
      method = "lm")

learing_curve_dat(dat=mtcars,
                  outcome="mpg",
                  test_prop = 1/5,
                  method="lm",
                  trControl = trainControl(method = "cv",
                                            number = 3,
                                            repeats = 1))

Using train in caret, we can easily customize the formula for lm. How can we pass customized formula to learing_curve_dat?

Regarding parameters for train, the documentation explicitly says that "These should not include x, y, formula, or data". How can I work around this constrain? Do I have to create and use my own model to do so?

BTW, why it is called learing_curve_dat, not learning_curve?


Updates:

I found that the train in learing_curve_dat only support Default S3 method, in order to pass formula as an parameter, we need S3 method for class 'formula'. I replace the train function to be an S3 method for class 'formula' in the source code and add form as an argument.

mod <- train(form=form,
             data=dat[in_mod,,drop=F],
             ...)