Function name: design_matrix
Description:

This function implements the R's "model.matrix" function and is used only when the x is a factor/charactervector or Dataframe.

Authors: Manos Papadakis