Solved the matrix problem

Fixed the trouble I was having with calculating all possible
combinations of the covariates. It was just a matter of defining the
classes of the inputs the functions should take, which is
c(“matrix”,”matrix”) in my case.