fact2mat function

Turn factor into multiple column