fct_encode_one_hot function

Encode a factor as a one-hot indicator matrix