to_fct function

Convert characters to factors