model.matrix function in R is a convenient way to transform training dataset for modeling. But it does not save any parameter used in transformation, so it is hard to apply the same transformation to test dataset or new dataset. ModelMatrixModel package is created to solve the problem.
Matrix
devtools::install_github(“xinyongtian/R_ModelMatrixModel”)
see vignettes
Xinyong Tian
GPL-3