factorise function

Put character vectors, columns of a data.frame or list elements as factor